Merge pull request #1847 from stac47/fix_1846

Fix recursive operator== call in C++20 (#1846)
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index 028235e..0910122 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -1083,6 +1083,7 @@
      */
     template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }
 
+#ifndef __cpp_lib_three_way_comparison
     //! Equal-to operator with arbitrary types (symmetric version)
     /*! \return (rhs == lhs)
      */
@@ -1093,6 +1094,7 @@
      */
     template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); }
     //@}
+#endif
 
     //!@name Type
     //@{