0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-28 16:24:56 +01:00

SERVER-17638 Fix StatusWith comparison operators

This commit is contained in:
Kaloian Manassiev 2015-03-20 13:14:55 -04:00
parent 2aeb5a17b1
commit 39e01c7669

View File

@ -184,22 +184,22 @@ namespace mongo {
//
template<typename T>
bool operator==(const StatusWith<T>& sw, const ErrorCodes& code) {
bool operator==(const StatusWith<T>& sw, const ErrorCodes::Error code) {
return sw.getStatus() == code;
}
template<typename T>
bool operator==(const ErrorCodes::Error& code, const StatusWith<T>& sw) {
bool operator==(const ErrorCodes::Error code, const StatusWith<T>& sw) {
return code == sw.getStatus();
}
template<typename T>
bool operator!=(const StatusWith<T>& sw, const ErrorCodes::Error& code) {
bool operator!=(const StatusWith<T>& sw, const ErrorCodes::Error code) {
return !(sw == code);
}
template<typename T>
bool operator!=(const ErrorCodes::Error& code, const StatusWith<T>& sw) {
bool operator!=(const ErrorCodes::Error code, const StatusWith<T>& sw) {
return !(code == sw);
}