Add value_type to improve integration with boost

Without value_type, Boost.Test version 1.65.0 throws a compiler error when a Json::Value object is compared to another with BOOST_TEST. Example and further discussion are in https://github.com/open-source-parsers/jsoncpp/issues/671.
This commit is contained in:
Wolfram Rösler 2017-09-14 09:31:36 +02:00 committed by GitHub
parent f2f19b03fb
commit ff6b449a07

View File

@ -190,6 +190,9 @@ public:
typedef Json::LargestUInt LargestUInt; typedef Json::LargestUInt LargestUInt;
typedef Json::ArrayIndex ArrayIndex; typedef Json::ArrayIndex ArrayIndex;
// Required for boost integration, e. g. BOOST_TEST
typedef std::string value_type;
static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value(). static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value().
static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null
static Value const& nullSingleton(); ///< Prefer this to null or nullRef. static Value const& nullSingleton(); ///< Prefer this to null or nullRef.