[swift-evolution] Bitshift operators

Dave Abrahams dabrahams at apple.com
Fri Jun 17 20:25:53 CDT 2016


on Fri Jun 17 2016, Ben Rimmington <swift-evolution at swift.org> wrote:

> <https://swift.org/documentation/api-design-guidelines/#type-conversion>
>
>> **In initializers that perform full-width type conversions, omit the
>> first argument label**, e.g. `Int64(someUInt32)`
>
> OptionSet could add `init(_ rawValue: RawValue)` to reduce boilerplate:
>
> 	struct FooOptions: OptionSet {
> 	    let rawValue: Int
>
> 	    static let bar = Self(0b01)
> 	    static let baz = Self(0b10)
> 	}

Great idea; please submit a proposal!

-- 
-Dave



More information about the swift-evolution mailing list