From 2425e4640cd70d0722c89a10dd834623c4ff1d6d Mon Sep 17 00:00:00 2001 From: groscoe2 <66085912+groscoe2@users.noreply.github.com> Date: Thu, 28 May 2020 13:56:58 -0500 Subject: [PATCH] Fix rapidjson for Clang 10 Based on Tencent/rapidjson#1679 Addresses USCiLab/cereal#631 --- include/cereal/external/rapidjson/document.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/include/cereal/external/rapidjson/document.h b/include/cereal/external/rapidjson/document.h index ca6da63d2..91c4be80f 100644 --- a/include/cereal/external/rapidjson/document.h +++ b/include/cereal/external/rapidjson/document.h @@ -24,6 +24,9 @@ #include "encodedstream.h" #include // placement new #include +#ifdef __cpp_lib_three_way_comparison +#include +#endif CEREAL_RAPIDJSON_DIAG_PUSH #ifdef __clang__ @@ -175,12 +178,16 @@ class GenericMemberIterator { //! @name relations //@{ - 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 //@} //! @name dereference