diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 1a59a14..68aaae7 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -24,7 +24,7 @@ #include "encodedstream.h" #include // placement new #include -#ifdef __cpp_impl_three_way_comparison +#ifdef __cpp_lib_three_way_comparison #include #endif @@ -250,16 +250,15 @@ public: //! @name relations //@{ -#ifdef __cpp_impl_three_way_comparison - template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } - template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } -#else - bool operator==(ConstIterator that) const { return ptr_ == that.ptr_; } - bool operator!=(ConstIterator that) const { return ptr_ != that.ptr_; } - bool operator<=(ConstIterator that) const { return ptr_ <= that.ptr_; } - bool operator>=(ConstIterator that) const { return ptr_ >= that.ptr_; } - bool operator< (ConstIterator that) const { return ptr_ < that.ptr_; } - bool operator> (ConstIterator that) const { return ptr_ > that.ptr_; } + template bool operator==(const GenericMemberIterator& that) const { return ptr_ == that.ptr_; } + template bool operator!=(const GenericMemberIterator& that) const { return ptr_ != that.ptr_; } + template bool operator<=(const GenericMemberIterator& that) const { return ptr_ <= that.ptr_; } + template bool operator>=(const GenericMemberIterator& that) const { return ptr_ >= that.ptr_; } + template bool operator< (const GenericMemberIterator& that) const { return ptr_ < that.ptr_; } + template bool operator> (const GenericMemberIterator& that) const { return ptr_ > that.ptr_; } + +#ifdef __cpp_lib_three_way_comparison + template std::strong_ordering operator<=>(const GenericMemberIterator& that) const { return ptr_ <=> that.ptr_; } #endif //@}