Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::error_category

std::error_category serves as the base class for specific error category types, such as std::system_category, std::iostream_category, etc.

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

Member functions

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

Specific error categories

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

See also

holds a portable error code
(class)
holds a platform-dependent error code
(class)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.