diff --git a/Source/CTest/cmCTestResourceAllocator.cxx b/Source/CTest/cmCTestResourceAllocator.cxx index a7ae7bc4dd..8aa2152c1e 100644 --- a/Source/CTest/cmCTestResourceAllocator.cxx +++ b/Source/CTest/cmCTestResourceAllocator.cxx @@ -72,15 +72,3 @@ bool cmCTestResourceAllocator::DeallocateResource(std::string const& name, resIt->second.Locked -= slots; return true; } - -bool cmCTestResourceAllocator::Resource::operator==( - Resource const& other) const -{ - return this->Total == other.Total && this->Locked == other.Locked; -} - -bool cmCTestResourceAllocator::Resource::operator!=( - Resource const& other) const -{ - return !(*this == other); -} diff --git a/Source/CTest/cmCTestResourceAllocator.h b/Source/CTest/cmCTestResourceAllocator.h index fcb5ef61fe..cf83c57384 100644 --- a/Source/CTest/cmCTestResourceAllocator.h +++ b/Source/CTest/cmCTestResourceAllocator.h @@ -17,8 +17,15 @@ public: unsigned int Free() const { return this->Total - this->Locked; } - bool operator==(Resource const& other) const; - bool operator!=(Resource const& other) const; + friend bool operator==(Resource left, Resource right) + { + return left.Total == right.Total && left.Locked == right.Locked; + } + + friend bool operator!=(Resource left, Resource right) + { + return !(left == right); + } }; void InitializeFromResourceSpec(cmCTestResourceSpec const& spec);