diff --git a/build/Doxyfile b/build/Doxyfile index 9d504b5..d2a57d5 100644 --- a/build/Doxyfile +++ b/build/Doxyfile @@ -1991,6 +1991,7 @@ INCLUDE_FILE_PATTERNS = # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = \ + RAPIDJSON_DOXYGEN_RUNNING \ RAPIDJSON_DISABLEIF_RETURN(cond,returntype)=returntype # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 33c97f4..66df387 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -355,8 +355,6 @@ public: private: //! Copy constructor is not permitted. GenericValue(const GenericValue& rhs); - //! Disabled constructor for arbitrary pointers. - template explicit GenericValue(T*); public: @@ -385,7 +383,18 @@ public: GenericValue(const GenericValue& rhs, Allocator & allocator); //! Constructor for boolean value. - explicit GenericValue(bool b) : data_(), flags_(b ? kTrueFlag : kFalseFlag) {} + /*! \param b Boolean value + \note This constructor is limited to \em real boolean values and rejects + implicitly converted types like arbitrary pointers. Use an explicit cast + to \c bool, if you want to construct a boolean JSON value in such cases. + */ +#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen + template + explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame))) +#else + explicit GenericValue(bool b) +#endif + : data_(), flags_(b ? kTrueFlag : kFalseFlag) {} //! Constructor for int value. explicit GenericValue(int i) : data_(), flags_(kNumberIntFlag) {