[swift-evolution] Bitshift operators

Ben Rimmington me at benrimmington.com
Fri Jun 17 07:51:27 CDT 2016


<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)
	}

-- Ben




More information about the swift-evolution mailing list