<div dir="ltr">There is a number of deficiencies with Swift and Numbers. Especially when trying to be clever with generics.<div><br></div><div>- The API exposes built in types like`BuiltIn.Word` as the return type of some APIs but there is no way to use said types.</div><div>- We have a Float and a Float80. Float and Doubles can't be initialised (via init) with anything but Integer values but Float80 can be initialized with both Floating Point and Integer</div><div>- We have a SignedNumberType but no UnsignedNumberType, All the floating points use this protocol, so shouldn't this be NumberType ?</div><div><div>- SignedIntegerType and UnsignedIntegerType have a way of generically constructing an Int as long as you cast it to the Maximum Int or UInt. But there is no such thing for Floating Point Numbers.</div><div>- We have Float80 and a typealised Float32 and Float64. Why couldn't have triple as an extra type name, as having one true type with a number is confusing ? </div></div><div>- If all number types could be initilized with all number types, then a lot of the constructors could be in the NumberType protocol.</div><div><br></div><div>Just in general it was hard to extend integers and floating point types. For example in my code I wanted to pass a struct that contained a value to any Floating Point or Integer and it would convert. </div><div><br></div><div>This is what I had to do, which is far too much and even sure I'm not convinced it will work in every condition.</div><div><br></div><div>
<p class=""><b><span class="">protocol</span><span class=""> Box: </span><span class="">CustomStringConvertible</span><span class="">, </span><span class="">CustomDebugStringConvertible</span><span class=""> {</span></b></p>
<p class=""><span class=""><b> </b></span></p>
<p class=""><b><span class=""> </span><span class="">typealias</span><span class=""> BoxType = Any</span></b></p>
<p class=""><span class=""><b> </b></span></p>
<p class=""><b><span class=""> </span><span class="">var</span><span class=""> value: </span><span class="">BoxType</span><span class=""> { </span><span class="">get</span><span class=""> </span><span class="">set</span><span class=""> }</span></b></p>
<p class=""><span class=""><b> </b></span></p>
<p class=""><b><span class=""> </span><span class="">init</span><span class="">()</span></b></p>
<p class=""><b><span class=""> </span><span class="">init</span><span class="">(</span><span class="">_</span><span class=""> value: </span><span class="">BoxType</span><span class="">)</span></b></p>
<p class=""><span class=""><b>}</b></span></p><p class=""><span class=""><b><br></b></span></p><p class=""><b><span class="">protocol</span><span class=""> AngleType: </span><span class="">Box</span><span class=""> {</span></b></p><p class=""><b><span class=""> </span><span class="">typealias</span><span class=""> BoxType = Double</span></b></p><p class=""><span class=""><b>
</b></span></p><p class=""><span class=""><b>}</b></span></p><p class=""><span class=""><b>//Mark:- Box - FloatingPointType Conversion</b></span></p><p class=""><b><span class=""></span><br></b></p><p class=""><b><span class="">extension</span><span class=""> </span><span class="">SignedIntegerType</span><span class=""> {</span></b></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Float80</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Double</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Float</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int8</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int16</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int32</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int64</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt8</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt16</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt32</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt64</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">IntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b>}</b></span></p><p class=""><b><span class=""></span><br></b></p><p class=""><b><span class="">extension</span><span class=""> </span><span class="">UnsignedIntegerType</span><span class=""> {</span></b></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Float80</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Double</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Float</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int8</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int16</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int32</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int64</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt8</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt16</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt32</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt64</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(</span><span class="">UIntMax</span><span class="">(value.</span><span class="">value</span><span class="">))</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b>}</b></span></p><p class=""><b><span class=""></span><br></b></p><p class=""><b><span class="">extension</span><span class=""> </span><span class="">Float</span></b></p><p class=""><span class=""><b>{</b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Float</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">)</span></b></p><p class=""><span class=""><b> {</b></span></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">value</span><span class=""> = value.</span><span class="">value</span><span class="">.</span><span class="">value</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b>}</b></span></p><p class=""><b><span class=""></span><br></b></p><p class=""><b><span class="">extension</span><span class=""> </span><span class="">Double</span></b></p><p class=""><span class=""><b>{</b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Double</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">)</span></b></p><p class=""><span class=""><b> {</b></span></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">value</span><span class=""> = value.</span><span class="">value</span><span class="">.</span><span class="">value</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b>}</b></span></p><p class=""><b><span class=""></span><br></b></p><p class=""><b><span class="">extension</span><span class=""> </span><span class="">Float80</span></b></p><p class=""><span class=""><b>{</b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Float80</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">)</span></b></p><p class=""><span class=""><b> {</b></span></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b>}</b></span></p><p class=""><b><span class=""></span><br></b></p><p class=""><b><span class="">extension</span><span class=""> </span><span class="">FloatingPointType</span><span class=""> {</span></b></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int8</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int16</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int32</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">Int64</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt8</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt16</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt32</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class=""><span class=""><b> </b></span></p><p class=""><b><span class=""> </span><span class="">init</span><span class=""><T: </span><span class="">Box</span><span class=""> </span><span class="">where</span><span class=""> </span><span class="">T</span><span class="">.</span><span class="">BoxType</span><span class=""> == </span><span class="">UInt64</span><span class="">>(</span><span class="">_</span><span class=""> value: </span><span class="">T</span><span class="">) {</span></b></p><p class=""><b><span class=""> </span><span class="">self</span><span class="">.</span><span class="">init</span><span class="">(value.</span><span class="">value</span><span class="">)</span></b></p><p class=""><span class=""><b> }</b></span></p><p class="">
</p><p class=""><span class=""><b>}</b></span></p></div><div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><span style="font-size:16px;line-height:19.2px"></span><span style="font-size:12.8px"> Wizard</span><br></div><div><a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a></div><div>+44 7523 279 698</div></div></div></div></div></div>
</div></div>