Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
basic_format_context::add_error

(Inherited from format_context_base)

Adds an error to the current error state.

Synopsis
void
add_error(
    error_code ec);
Description

This function can be used by custom formatters to report that they received a value that can't be formatted. For instance, it's used by the built-in string formatter when a string with an invalid encoding is supplied.

If the error state is not set before calling this function, the error state is updated to ec. Otherwise, the error is ignored. This implies that once the error state is set, it can't be reset.

Exception safety

No-throw guarantee.


PrevUpHomeNext