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 np) noexcept; (7)
Description
This function prepares the serializer to emit a new serialized JSON representing its argument: *p
(1)–(5), sv
(6), or np
(7). Ownership is not transferred. The caller is responsible for ensuring that the lifetime of the object pointed to by the argument extends until it is no longer needed.
Any memory internally allocated for previous uses of this serializer
object is preserved and re-used for the new output.
Overload (5) uses direct serialization.
Parameters
Name | Description |
---|---|
|
A pointer to the element to serialize. |
|
The characters representing a string. |
|
Represents a null value. |