From a9add7bd2ad6ed0711c4059c4e9dbce2913e498c Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Tue, 26 Aug 2014 20:06:25 +0200 Subject: [PATCH] GenericValue: add non-template overload for operator!= As reported in #113, recent versions of Clang complain about ambiguous overloads for some comparison operator instantiations, especially if the deduced template type is a GenericValue. Add an explicit, non-templated version for now (which is a better match). This only solves part of the problem, as comparisons between * GenericValue & GenericDocument * GenericValue with different SourceAllocator types will still cause ambiguities. --- include/rapidjson/document.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 965cefe..5d8e079 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -685,6 +685,11 @@ public: */ template RAPIDJSON_DISABLEIF_RETURN(internal::IsPointer, bool) operator==(const T& rhs) const { return *this == GenericValue(rhs); } + //! Not-equal-to operator + /*! \return !(*this == rhs) + */ + bool operator!=(const GenericValue& rhs) const { return !(*this == rhs); } + //! Not-equal-to operator with arbitrary types /*! \return !(*this == rhs) */