From 424d1b95c7d95ac82f49bba82fdd05c29f73a2c1 Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Mon, 14 Mar 2022 12:25:26 -0700 Subject: [PATCH 5/7] gate definition of symmetric equality operators on impl, not lib These operators call themselves recursively if C++20 semantics are present in the compiler, regardless of standard library support for the operator; therefore the test should be on __cpp_impl_three_way_comparison, not __cpp_lib_[...]. This fixes the Value.EqualtoOperator test when the language standard is set to C++20 and the standard library does not yet define the library support macro. --- include/rapidjson/document.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 3c354a79..46510f85 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -926,7 +926,7 @@ public: */ template RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); } -#ifndef __cpp_lib_three_way_comparison +#ifndef __cpp_impl_three_way_comparison //! Equal-to operator with arbitrary types (symmetric version) /*! \return (rhs == lhs) */ -- 2.43.0