Skip to content

Commit 24ebd51

Browse files
author
Laurent Stacul
committed
Fix recursive operator== call in C++20 (Tencent#1846)
1 parent 8bce684 commit 24ebd51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/rapidjson/document.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ class GenericValue {
10831083
*/
10841084
template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }
10851085

1086+
#ifndef __cpp_lib_three_way_comparison
10861087
//! Equal-to operator with arbitrary types (symmetric version)
10871088
/*! \return (rhs == lhs)
10881089
*/
@@ -1093,6 +1094,7 @@ class GenericValue {
10931094
*/
10941095
template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); }
10951096
//@}
1097+
#endif
10961098

10971099
//!@name Type
10981100
//@{

0 commit comments

Comments
 (0)