because in C++20, comparison operator is considered reversed also. so
drop the reversed operators.
otherwise we'd have following FTBFS:
../src/test/common/test_static_ptr.cc:64:20: error: use of overloaded operator '==' is ambiguous (with operand types 'static_ptr<base, sizeof(grandchild)>' and 'nullptr_t')
EXPECT_FALSE(p == nullptr);
~ ^ ~~~~~~~
../src/googletest/googletest/include/gtest/gtest.h:1984:25: note: expanded from macro 'EXPECT_FALSE'
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
^~~~~~~~~
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
return !s;
}
template<typename Base, std::size_t Size>
-bool operator ==(std::nullptr_t, const static_ptr<Base, Size>& s) {
- return !s;
-}
-template<typename Base, std::size_t Size>
bool operator ==(static_ptr<Base, Size>& s, std::nullptr_t) {
return !s;
}
-template<typename Base, std::size_t Size>
-bool operator ==(std::nullptr_t, static_ptr<Base, Size>& s) {
- return !s;
-}
// Since `make_unique` and `make_shared` exist, we should follow their
// lead.