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:
Dave Abrahams
2015-05-22 00:13:53 +00:00
parent 6e7d6b980b
commit 21b9a97e88
11 changed files with 481 additions and 518 deletions

View File

@@ -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 {