diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/rapidjson/document.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 3f66e41d..1a59a14e 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -24,6 +24,9 @@ #include "encodedstream.h" #include <new> // placement new #include <limits> +#ifdef __cpp_impl_three_way_comparison +#include <compare> +#endif RAPIDJSON_DIAG_PUSH #ifdef __clang__ @@ -247,12 +250,17 @@ public: //! @name relations //@{ +#ifdef __cpp_impl_three_way_comparison + template <bool Const_> bool operator==(const GenericMemberIterator<Const_,Encoding,Allocator>& that) const { return ptr_ == that.ptr_; } + template <bool Const_> std::strong_ordering operator<=>(const GenericMemberIterator<Const_,Encoding,Allocator>& 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_; } +#endif //@} //! @name dereference |