std::_V2::error_category Class Referenceabstract
Diagnostics

`#include <system_error>`

## Public Member Functions

| error_category (const error_category &)=delete
virtual error_condition | default_error_condition (int __i) const noexcept
virtual bool | equivalent (const error_code &__code, int __i) const noexcept
virtual bool | equivalent (int __i, const error_condition &__cond) const noexcept
virtual string | message (int) const =0
virtual const char * | name () const noexcept=0
bool | operator!= (const error_category &__other) const noexcept
bool | operator< (const error_category &__other) const noexcept
error_category & | operator= (const error_category &)=delete
bool | operator== (const error_category &__other) const noexcept

## Detailed Description

Abstract base class for types defining a category of error codes.

An error category defines a context that gives meaning to the integer stored in an error_code or error_condition object. For example, the standard errno constants such a EINVAL and ENOMEM are associated with the "generic" category and other OS-specific error numbers are associated with the "system" category, but a user-defined category might give different meanings to the same numerical values.

A user-defined category can override the equivalent member functions to define correspondence between errors in different categories. For example, a category for errors from disk I/O could consider some of its error numbers equivalent to ENOSPC and ENOENT in the generic category.

Since
  C++11

Definition at line 106 of file system_error.

## Member Function Documentation

## default_error_condition()

virtual error_condition std::_V2::error_category::default_error_condition | ( | int | __i | ) | const

virtual noexcept

Return an error_condition corresponding to i in this category.

## equivalent() [1/2]

virtual bool std::_V2::error_category::equivalent | ( | const error_code & | __code,
|  | int | __i ) const

virtual noexcept

Test whether code corresponds to i for this category.

## equivalent() [2/2]

virtual bool std::_V2::error_category::equivalent | ( | int | __i,
|  | const error_condition & | __cond ) const

virtual noexcept

Test whether cond corresponds to i for this category.

## message()

virtual string std::_V2::error_category::message | ( | int |  | ) | const

pure virtual

A description of the error condition corresponding to the number.

References message().

Referenced by message(), std::error_code::message(), and std::error_condition::message().

## name()

virtual const char * std::_V2::error_category::name | ( |  | ) | const

pure virtual noexcept

A string that identifies the error category.

## operator!=()

bool std::_V2::error_category::operator!= | ( | const error_category & | __other | ) | const

inline noexcept

Definition at line 175 of file system_error.

## operator<()

bool std::_V2::error_category::operator< | ( | const error_category & | __other | ) | const

inline noexcept

Ordered comparison that defines a total order for error categories.

Definition at line 170 of file system_error.

References operator<().

Referenced by operator<().

## operator==()

bool std::_V2::error_category::operator== | ( | const error_category & | __other | ) | const

inline noexcept

An error_category only compares equal to itself.

Definition at line 160 of file system_error.

The documentation for this class was generated from the following file:

- system_error