cpp/io/ios base/failure

The class defines an exception object that is thrown on failure by the functions in the Input/Output library.

Member functions
{{member|{{small|std::ios_base::failure::}}failure| {{dcl begin}} {{dcl rev multi|num=1|until1=c++11 explicit failure( const std::string& message ); explicit failure( const std::string& message,                  const std::error_code& ec = std::io_errc::stream ); }} {{dcl|num=2|since=c++11|1= explicit failure( const char* message,                 const std::error_code& ec = std::io_errc::stream ); }} {{dcl rev multi|num=3|until1=c++11 failure( const failure& other ); failure( const failure& other ) noexcept; }} {{dcl end}}
 * dcl1=
 * dcl2=
 * dcl1=
 * dcl2=

@1-2@ Constructs the exception object using {{c|message}} as explanation string which can later be retrieved using {{ltf|cpp/error/exception/what}}. {{rev inl|since=c++11|{{c|ec}} is used to identify the specific reason for the failure.}} @3@ Copy constructor. Initialize the contents with those of {{c|other}}. {{rev inl|since=c++11|If {{c|*this}} and {{c|other}} both have dynamic type {{tt|std::ios_base::failure}} then {{c|1=std::strcmp(what, other.what) == 0}}.}}