Skip to content

Commit ff6b449

Browse files
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 open-source-parsers#671.
1 parent f2f19b0 commit ff6b449

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/json/value.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ class JSON_API Value {
190190
typedef Json::LargestUInt LargestUInt;
191191
typedef Json::ArrayIndex ArrayIndex;
192192

193+
// Required for boost integration, e. g. BOOST_TEST
194+
typedef std::string value_type;
195+
193196
static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value().
194197
static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null
195198
static Value const& nullSingleton(); ///< Prefer this to null or nullRef.

0 commit comments

Comments
 (0)