serializer::serializer

Constructors.

Synopsis

serializer(
    serialize_options const& opts = {}) noexcept; (1)

serializer(
    storage_ptr sp,
    unsigned char* buf = nullptr,
    std::size_t size = 0,
    serialize_options const& opts = {}) noexcept; (2)

serializer(
    serializer&&) = delete; (3)

Description

The serializer is constructed with no value to serialize The value may be set later by calling reset. If serialization is attempted with no value, the output is as if a null value is serialized.

Overload (3) is a move constructor. The type is neither copyable nor movable, so this constructor is deleted.

Complexity

Constant.

Exception Safety

No-throw guarantee.

Parameters

Name Description

opts

The options for the serializer. If this parameter is omitted, the serializer will output only standard JSON.

sp

A pointer to the boost::container::pmr::memory_resource to use when producing partial output. Shared ownership of the memory resource is retained until the serializer is destroyed.

buf

An optional static buffer to use for temporary storage when producing partial output.

size

The number of bytes of valid memory pointed to by buf.