| Home | Libraries | People | FAQ | More

##### format_context_base::append_value

Formats a value and adds it to the output string (low level).

###### Synopsis

    format_context_base&
    append_value(
        formattable_ref value,
        constant_string_view format_specifiers = string_view());

###### Description

value is formatted according to its type, applying the passed format specifiers. If formatting generates an error (for instance, a string with invalid encoding is passed), the error state may be set.

This is a low level function. In general, prefer `format_sql_to`, instead.

###### Exception safety

Basic guarantee. Memory allocations may throw.

###### Errors

The error state may be updated with the following errors:

- `client_errc::invalid_encoding` if a string with byte sequences that can't be decoded with the current character set is passed.
- `client_errc::unformattable_value` if a NaN or infinity `float` or `double` is passed.
- `client_errc::format_string_invalid_specifier` if `format_specifiers` includes specifiers not supported by the type being formatted.
- Any other error code that user-supplied formatter specializations may add using `add_error`.