std::error_category(3)

๐Ÿ’– NAME ๐Ÿ’–

std::error_category - std::error_category

Okay bestie, this is page std::error_category(3) from the C++ Standard Libary manual, and we are gonna make it make sense together ๐Ÿซถ


๐ŸŒธ Synopsis ๐ŸŒธ

Defined in header <system_error>
class error_category;             (since C++11)

So std::error_category is the base class for specific error category types โ€” think 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. Periodt ๐Ÿ’…


๐ŸŽ€ Member functions ๐ŸŽ€

  • constructor โ€” constructs an error_category (public member function) โœจ
  • destructor โ€” destructs an error_category; tagged [virtual] (virtual public member function)
  • operator= โ€” not copy assignable; tagged [deleted] (public member function)
  • name โ€” obtains the name of the category; tagged [virtual] (virtual public member function) ๐Ÿท๏ธ
  • default_error_condition โ€” maps error_code to error_condition; tagged [virtual] (virtual public member function) ๐Ÿ”
  • equivalent โ€” compares error_code and error_condition for equivalence; tagged [virtual] (virtual public member function) โš–๏ธ
  • message โ€” obtains the explanatory string; tagged [virtual] (virtual public member function) ๐Ÿ’ฌ

Then there's the operator crew, exactly as the page lists it:

  • operator==
  • operator!=
  • operator< โ€” compares two error categories
  • operator<=> โ€” (function)
  • (removed in C++20)
  • (removed in C++20)
  • (C++20)

๐ŸŒˆ Specific error categories ๐ŸŒˆ

  • generic_category โ€” identifies the generic error category; (C++11) (function) ๐ŸŒฑ
  • system_category โ€” identifies the operating system error category; (C++11) (function) ๐Ÿ–ฅ๏ธ
  • iostream_category โ€” identifies the iostream error category; (C++11) (function) ๐ŸŒŠ
  • future_category โ€” identifies the future error category; (C++11) (function) ๐Ÿ”ฎ

โญ See also โญ

  • error_condition โ€” holds a portable error code; (C++11) (class) ๐Ÿงณ
  • error_code โ€” holds a platform-dependent error code; (C++11) (class) ๐Ÿงฉ

made with ๐Ÿ’– from http://cppreference.com, version/date 2024.06.10, page std::error_category(3). bye bestie, go slay those error categories ๐Ÿฆ‹๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from