add std::to_string method for json object

This commit is contained in:
delta37 2018-01-16 18:33:42 +03:00
parent d9446b0e6e
commit 57db153ea7

View File

@ -15289,6 +15289,18 @@ inline nlohmann::json operator "" _json(const char* s, std::size_t n)
return nlohmann::json::parse(s, s + n);
}
/*!
@brief user-defined to_string function for JSON values
This function implements a user-defined to_string for JSON objects.
@param[in] j a JSON object
@return a std::string object
*/
inline std::string to_string(const nlohmann::json& j) {
return j.dump();
}
/*!
@brief user-defined string literal for JSON pointer