mirror of
https://github.com/nlohmann/json.git
synced 2025-07-28 12:02:00 +03:00
Added to_string (with ugly macro) and tests
This commit is contained in:
@ -20766,6 +20766,21 @@ class basic_json
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
||||
/*!
|
||||
@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
|
||||
*/
|
||||
|
||||
NLOHMANN_BASIC_JSON_TPL_DECLARATION
|
||||
std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j)
|
||||
{
|
||||
return j.dump();
|
||||
}
|
||||
} // namespace nlohmann
|
||||
|
||||
///////////////////////
|
||||
|
Reference in New Issue
Block a user