`Boolean` (the protocol) was removed in Swift 3 per SE-0109 “Remove the Boolean 
protocol”.

<https://github.com/apple/swift-evolution/blob/master/proposals/0109-remove-boolean.md>

You can do what you want by defining your own dummy protocol and extending 
`Bool` (the type) to conform to that.

protocol JensBoolean {
}

extension Bool : JensBoolean {
}

public struct Foo<T> {
}

extension Foo where T : JensBoolean {
}

There’s an obvious need to make this better — search the ’net for “generics 
manifesto” for some context — but that didn’t catch the Swift 3 bus.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to