[swift-evolution] protocol-oriented integers (take 2)

Max Moiseev moiseev at apple.com
Mon Jan 30 13:39:41 CST 2017


> On Jan 30, 2017, at 12:21 AM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> On Jan 29, 2017, at 10:07 PM, Dave Abrahams <dabrahams at apple.com> wrote:
>> 
>>>>> It might make a great deal of sense to support bitwise operations on
>>>>> this type, 
>>>> 
>>>> I think that's a model of SetAlgebra, then, isn't it?
>>> 
>>> Hmm, arguably. It's a shame that we won't be able to use it with
>>> things like `OptionSet`, though.
>> 
>> Why not?  That conforms to SetAlgebra.
> 
> I mean that `OptionSet.RawValue` currently has to conform to `BitwiseOperations`, but would now need to conform to `BinaryInteger` (or a sub-protocol).
It is not a protocol requirement, just a way for the standard library to provide a default implementation.
BitwiseOperations was replaced by the FixedWidthInteger in the prototype for this case.

> 
> -- 
> Brent Royal-Gordon
> Architechies
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list