std::error_code

From cppreference.com
 
 
 
Error handling
Exception handling
exception
uncaught_exception
exception_ptr (C++11)
make_exception_ptr (C++11)
current_exception (C++11)
rethrow_exception (C++11)
nested_exception (C++11)
throw_with_nested (C++11)
rethrow_if_nested (C++11)
Exception handling failures
terminate
terminate_handler
get_terminate (C++11)
set_terminate
unexpected (deprecated)
bad_exception
unexpected_handler (deprecated)
get_unexpected (C++11)(deprecated)
set_unexpected (deprecated)
Exception categories
logic_error
invalid_argument
domain_error
length_error
out_of_range
runtime_error
range_error
overflow_error
underflow_error
Error codes
Error codes
errno
Assertions
assert
system_error facility
error_category (C++11)
generic_category (C++11)
system_category (C++11)
error_condition (C++11)
errc (C++11)
error_code (C++11)
system_error (C++11)
 
 
Defined in header <system_error>
class error_code;
(since C++11)

std::error_code is a platform-dependent error code. Each std::error_code object holds a pair of error code originating from the operating system, or some low-level interface and a pointer to an object of type std::error_category, which corresponds to the said interface. The error code values may be not unique across different error categories.

Contents

[edit] Member functions

constructs an error code
(public member function)
assigns another error code
(public member function)
assigns another error code
(public member function)
Modifiers
sets the error_code to value 0 in generic_category
(public member function)
Observers
obtains the value of the error_code
(public member function)
obtains the error_category for this error_code
(public member function)
obtains the error_condition for this error_code
(public member function)
obtains the explanatory string for this error_code
(public member function)
checks if the value is non-zero
(public member function)

[edit] Non-member functions

compares two error_codes
(function)
outputs the value and the message to an output stream
(function)
creates an error code from an error_category
(function)

[edit] Helper classes

identifies a class as an error_code enumeration
(class template)
hash support for std::error_code
(class template specialization)

[edit] See also

holds a portable error code
(class)
base class for error categories
(class)