mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ClangImporter] Turn ImportNameVersion into a struct.
...so that we don't have to keep coming back to update it every major release. And also so we can actually put methods on it instead of using free functions. No intended behavior change (yet).
This commit is contained in:
@@ -786,6 +786,24 @@ inline OutputIterator transform(const Container &C, OutputIterator result,
|
||||
return std::transform(C.begin(), C.end(), result, op);
|
||||
}
|
||||
|
||||
/// Provides default implementations of !=, <=, >, and >= based on == and <.
|
||||
template <typename T>
|
||||
class RelationalOperationsBase {
|
||||
public:
|
||||
friend bool operator>(const T &left, const T &right) {
|
||||
return right < left;
|
||||
}
|
||||
friend bool operator>=(const T &left, const T &right) {
|
||||
return !(left < right);
|
||||
}
|
||||
friend bool operator<=(const T &left, const T &right) {
|
||||
return !(right < left);
|
||||
}
|
||||
friend bool operator!=(const T &left, const T &right) {
|
||||
return !(left == right);
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace swift
|
||||
|
||||
#endif // SWIFT_BASIC_INTERLEAVE_H
|
||||
|
||||
Reference in New Issue
Block a user