> On Jan 13, 2017, at 12:47, Max Moiseev via swift-evolution
> <swift-evolution@swift.org> wrote:
> DoubleWidth
> The DoubleWidth<T> type allows to create wider fixed-width integer types from
> the ones available in the standard library.
>
> Standard library currently provides fixed-width integer types of up to 64
> bits. A value of DoubleWidth<Int64> will double the range of the underlying
> type and implement all the FixedWidthInteger requirements. Please note though
> that the implementation will not necessarily be the most efficient one, so it
> would not be a good idea to use DoubleWidth<Int32>instead of a built-in Int64.
>
What about having a "CompoundBinaryInteger<T,U>" type, and then do "typealias
DoubleWidth<T> = CompoundBinaryInteger<T,T>"? That would make it easier to
have, say, 40-bit ints, "CompoundBinaryInteger<Int8,Int32>", while still having
the convenience of "DoubleWidth<T>".
- Dave Sweeris
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution