serializer::reset

Reset the serializer for a new element.

Synopsis

void
reset(
    value const* p) noexcept; (1)

void
reset(
    array const* p) noexcept; (2)

void
reset(
    object const* p) noexcept; (3)

void
reset(
    string const* p) noexcept; (4)

template<
    class T>
void
reset(
    T const* p) noexcept; (5)

void
reset(
    string_view sv) noexcept; (6)

void
reset(
    std::nullptr_t) noexcept; (7)

Description

This function prepares the serializer to emit a new serialized JSON representing *p. Any internally allocated memory is preserved and re-used for the new output.

Parameters

Name Description

p

A pointer to the element to serialize. Ownership is not transferred; The caller is responsible for ensuring that the lifetime of *p extends until it is no longer needed.

sv

The characters representing the string. Ownership is not transferred; The caller is responsible for ensuring that the lifetime of the characters reference by sv extends until it is no longer needed.