| Home | Libraries | People | FAQ | More

###### parser::parser (6 of 8 overloads)

Constructor.

<h7> Synopsis </h7>

    template<
        std::size_t N>
    parser(
        storage_ptr sp,
        parse_options const& opt,
        unsigned char(&) buffer [N]);

<h7> Description </h7>

This constructs a new parser which first uses the caller-owned storage `buffer` for temporary storage, falling back to the memory resource `sp` if needed. The parser will use the specified parsing options.

The parsed value will use the default memory resource for storage. To use a different resource, call `reset` after construction.

<h7> Complexity </h7>

Constant.

<h7> Exception Safety </h7>

No-throw guarantee.

<h7> Parameters </h7>

Name | Description
--- | ---
`sp` | The memory resource to use for temporary storage after `buffer` is exhausted.
`opt` | The parsing options to use.
`buffer` | A buffer for the parser to use for temporary storage. Ownership is not transferred, the caller is responsible for ensuring the lifetime of `buffer` extends until the parser is destroyed.