public pure virtual member function

std::error_category::name

<system_error>
virtual const char* name() const noexcept = 0;
Return category name
In derived classes, the function returns a C-string naming the category.

In error_category, it is a pure virtual member function.

In the generic_category object, it returns "generic".
In the system_category object, it returns "system".
In the iostream_category object, it returns "iostream".

Parameters

none

Return Value

A pointer to the first character of a null-terminated character sequence.

Example

1
2
3
4
5
6
7
8
9
// error_category::name
#include <iostream>
#include <system_error>

int main() {
  std::error_code ec;	// the default error code is system error 0
  std::cout << ec.category().name() << std::endl;
  return 0;
}


Output:
system


See also