...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Adds an error to the current error state.
void add_error( error_code ec);
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.
No-throw guarantee.