Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
serialize (1 of 5 overloads)

Return a string representing a serialized element.

Synopsis

Defined in header <boost/json/serialize.hpp>

std::string
serialize(
    value const& t);
Description

This function serializes t as JSON and returns it as a std::string.

Complexity

Constant or linear in the size of t.

Exception Safety

Strong guarantee. Calls to allocate may throw.

Return Value

The serialized string

Parameters

Name

Description

t

The value to serialize

Convenience header <boost/json.hpp>


PrevUpHomeNext