public pure virtual member function
<system_error>
virtual const char* name() const noexcept = 0;
Return category name
Return Value
A pointer to the first character of a null-terminated character sequence with the category name.
Example
1 2 3 4 5 6 7 8 9
|
// error_category::name
#include <iostream> // std::cout
#include <system_error> // std::error_code
int main() {
std::error_code ec; // the default error code is system error 0
std::cout << ec.category().name() << '\n';
return 0;
}
|
Output: