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.
This commit is contained in:
Philipp A. Hartmann 2014-08-26 20:06:25 +02:00
parent 38889835ce
commit a9add7bd2a

View File

@ -685,6 +685,11 @@ public:
*/
template <typename T> RAPIDJSON_DISABLEIF_RETURN(internal::IsPointer<T>, 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)
*/