W3cubDocs

/C++

std::error_code

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 an 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.

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 system_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)

Non-member functions

(removed in C++20)(removed in C++20)(C++20)
compares two error_codes
(function)
outputs the value and the category name to an output stream
(function)

Helper classes

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

See also

(C++11)
holds a portable error code
(class)
(C++11)
base class for error categories
(class)
(C++11)
constructs an std::errc error code
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/error/error_code