...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return a string representing a serialized element.
Defined in header <boost/json/serialize.hpp>
std::string serialize(object
const& t,serialize_options
const& opts = {});
This function serializes t
as JSON and returns it as a std::string
.
Constant or linear in the size of t
.
Strong guarantee. Calls to allocate may throw.
The serialized string
Name |
Description |
---|---|
|
The value to serialize |
|
The options for the serializer. If this parameter is omitted, the serializer will output only standard JSON. |
Convenience header <boost/json.hpp>