Skip to content

Commit 64faab2

Browse files
mumbleskatesmiloyip
authored andcommitted
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.
1 parent 719304b commit 64faab2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/rapidjson/document.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ class GenericValue {
10921092
*/
10931093
template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }
10941094

1095-
#ifndef __cpp_lib_three_way_comparison
1095+
#ifndef __cpp_impl_three_way_comparison
10961096
//! Equal-to operator with arbitrary types (symmetric version)
10971097
/*! \return (rhs == lhs)
10981098
*/

0 commit comments

Comments
 (0)