mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[stdlib] Land OptionSetType et. al."
This reverts commit r28892, r28894, and r28895. They broke validation tests; JoeG is going to look at what's needed to make them work again. Swift SVN r28897
This commit is contained in:
@@ -60,29 +60,6 @@ public protocol _RawOptionSetType : RawRepresentable, Equatable {
|
||||
init(rawValue: RawValue)
|
||||
}
|
||||
|
||||
/// Returns `true` iff `lhs.rawValue == rhs.rawValue`.
|
||||
public func == <
|
||||
T : RawRepresentable where T.RawValue : Equatable
|
||||
>(lhs: T, rhs: T) -> Bool {
|
||||
return lhs.rawValue == rhs.rawValue
|
||||
}
|
||||
|
||||
/// Returns `true` iff `lhs.rawValue != rhs.rawValue`.
|
||||
public func != <
|
||||
T : RawRepresentable where T.RawValue : Equatable
|
||||
>(lhs: T, rhs: T) -> Bool {
|
||||
return lhs.rawValue != rhs.rawValue
|
||||
}
|
||||
|
||||
// This overload is needed for ambiguity resolution against the
|
||||
// implementation of != for T : Equatable
|
||||
/// Returns `true` iff `lhs.rawValue != rhs.rawValue`.
|
||||
public func != <
|
||||
T : Equatable where T : RawRepresentable, T.RawValue : Equatable
|
||||
>(lhs: T, rhs: T) -> Bool {
|
||||
return lhs.rawValue != rhs.rawValue
|
||||
}
|
||||
|
||||
public func == <T : _RawOptionSetType>(a: T, b: T) -> Bool {
|
||||
return a.rawValue == b.rawValue
|
||||
}
|
||||
@@ -100,6 +77,11 @@ public prefix func ~ <T : _RawOptionSetType>(a: T) -> T {
|
||||
return T(rawValue: ~a.rawValue)
|
||||
}
|
||||
|
||||
/// Protocol for C-like option sets.
|
||||
public protocol _OptionSetType {
|
||||
// TODO: implementation, API review
|
||||
}
|
||||
|
||||
/// Protocol for `NS_OPTIONS` imported from Objective-C.
|
||||
public protocol RawOptionSetType : _RawOptionSetType, BitwiseOperationsType,
|
||||
NilLiteralConvertible {
|
||||
|
||||
Reference in New Issue
Block a user