Why does the following code not compile (no match for 'operator==')? Is this syntax allowed? If yes, how to fix the code? If not, where does the standard say that?
#include <vector>
template <typename T>
struct VectorWrapper {
using ValueType = std::vector<T>;
constexpr auto operator<=>(const VectorWrapper&) const noexcept = default;
constexpr auto operator<=>(const ValueType& otherValue) const noexcept {
return v <=> otherValue;
}
ValueType v;
};
bool f() {
VectorWrapper<int> v;
return v == std::vector {0};
}