std::format_error

From cppreference.com
< cpp‎ | utility‎ | format
 
 
 
Formatting library
Formatting functions
(C++20)
(C++20)
(C++20)
(C++20)
Formatter
(C++20)
Formatting arguments
Format error
format_error
(C++20)
 
Defined in header <format>
class format_error;
(since C++20)

Defines the type of exception object thrown to report errors in the formatting library.

cpp/error/exceptioncpp/error/runtime errorstd-format error-inheritance.svg

Inheritance diagram

Member functions

(constructor)
constructs the format_error object with the given message
(public member function)

std::format_error::format_error

explicit format_error( const std::string& what_arg );
(1)
explicit format_error( const char* what_arg );
(2)

Constructs the exception object with what_arg as explanatory string that can be accessed through what().

Inherited from std::exception

Member functions

[virtual]
destroys the exception object
(virtual public member function of std::exception)
[virtual]
returns an explanatory string
(virtual public member function of std::exception)

Example

See also