std::ios_base::failure (3) - Linux Manuals
std::ios_base::failure: std::ios_base::failure
NAME
std::ios_base::failure - std::ios_base::failure
Synopsis
Defined in header <ios>
class failure;
The class std::ios_base::failure defines an exception object that is thrown on failure by the functions in the Input/Output library.
std::ios_base::failure may be defined either as a member class of std::ios_base or as a synonym (typedef) for another class with equivalent functionality.
(since C++17)
std-ios base-failure-2003-inheritance.svg (until C++11)
Inheritance diagram
std-ios base-failure-inheritance.svg (since C++11)
Inheritance diagram
Member functions
constructor (public member function)
std::ios_base::failure::failure
explicit failure( const std::string& message ); (until C++11)
explicit failure( const std::string& message, (since C++11)
const std::error_code& ec = std::io_errc::stream );
explicit failure( const char* message, (since C++11)
const std::error_code& ec = std::io_errc::stream );
Constructs the exception object using message as explanation string which can later be retrieved using what().
Parameters
message - explanatory string
Inherited from std::system_error
Member functions
code (public member function of std::system_error)
what returns explanatory string
[virtual]
Inherited from std::runtime_error
Inherited from std::exception
Member functions
destructor destroys the exception object
[virtual]
what returns an explanatory string
[virtual]
Example
// Run this code
Output:
See also
io_errc the IO stream error codes
(C++11)