|
|
@@ -127,15 +127,19 @@ public:
|
|
|
return std::make_unique<GenericConst<value_type>>(const_value());
|
|
|
}
|
|
|
|
|
|
- template <typename Other>
|
|
|
- requires std::totally_ordered_with<JSON, typename Other::value_type> std::strong_ordering
|
|
|
- operator<=>(SimpleAdapter const & rhs) const {
|
|
|
+ auto operator<=>(SimpleAdapter const & rhs) const requires std::totally_ordered<JSON> {
|
|
|
using ord = std::strong_ordering;
|
|
|
if (value_ == rhs.value_) {
|
|
|
- return std::strong_ordering::equal;
|
|
|
+ return ord::equal;
|
|
|
}
|
|
|
if (value_ && rhs.value_) {
|
|
|
- return *value_ <=> *rhs.value_;
|
|
|
+ if (*value_ < *rhs.value_) {
|
|
|
+ return ord::less;
|
|
|
+ }
|
|
|
+ if (*rhs.value_ < *value_) {
|
|
|
+ return ord::greater;
|
|
|
+ }
|
|
|
+ return ord::equal;
|
|
|
}
|
|
|
if (value_) {
|
|
|
return type() == Type::Null ? ord::equivalent : ord::greater;
|