Namespaces
Variants
Views
Actions

std::error_category

From cppreference.com
< cpp‎ | error
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
Diagnostics library
Exception handling
Exception handling failures
(until C++17*)
(until C++17*)
(C++11)(until C++17*)    
(until C++17*)
Error codes
Error codes
Exception categories
System error support
error_category
(C++11)
(C++11)
(C++11)
Assertions
Stacktrace
 
 
Defined in header <system_error>
class error_category;
(since C++11)

std::error_category serves as the base class for specific error category types, such as std::system_category, std::iostream_category, etc. Each specific category class defines the error_code - error_condition mapping and holds the explanatory strings for all error_conditions. The objects of error category classes are treated as singletons, passed by reference.

[edit] Member functions

constructs an error_category
(public member function) [edit]
[virtual]
destructs an error_category
(virtual public member function) [edit]
operator=
[deleted]
not copy assignable
(public member function) [edit]
[virtual]
obtains the name of the category
(virtual public member function) [edit]
maps error_code to error_condition
(virtual public member function) [edit]
[virtual]
compares error_code and error_condition for equivalence
(virtual public member function) [edit]
[virtual]
obtains the explanatory string
(virtual public member function) [edit]
(removed in C++20)(removed in C++20)(C++20)
compares two error categories
(function) [edit]

[edit] Specific error categories

identifies the generic error category
(function) [edit]
identifies the operating system error category
(function) [edit]
identifies the iostream error category
(function) [edit]
identifies the future error category
(function) [edit]

[edit] See also

holds a portable error code
(class) [edit]
holds a platform-dependent error code
(class) [edit]