libstdc++: Diagnostics

libstdc++

Diagnostics
Collaboration diagram for Diagnostics:

## Topics
| Exceptions

## Classes
class | std::error_category
class | std::error_code
class | std::error_condition
struct | std::is_error_code_enum< _Tp >
struct | std::is_error_condition_enum< _Tp >

## Functions
const error_category & | std::generic_category () noexcept
error_code | make_error_code (errc __e) noexcept
error_condition | make_error_condition (errc __e) noexcept
template<typename _CharT, typename _Traits>
basic_ostream< _CharT, _Traits > & | operator<< (basic_ostream< _CharT, _Traits > &__os, const error_code &__e)
strong_ordering | operator<=> (const error_code &__lhs, const error_code &__rhs) noexcept
strong_ordering | operator<=> (const error_condition &__lhs, const error_condition &__rhs) noexcept
bool | operator== (const error_code &__lhs, const error_code &__rhs) noexcept
bool | operator== (const error_code &__lhs, const error_condition &__rhs) noexcept
bool | operator== (const error_condition &__lhs, const error_condition &__rhs) noexcept
const error_category & | std::system_category () noexcept

## Variables
template<typename _Tp>
constexpr bool | std::is_error_code_enum_v
template<typename _Tp>
constexpr bool | std::is_error_condition_enum_v

## Detailed Description

Components for error handling, reporting, and diagnostic operations.

## Function Documentation

## ◆ generic_category()

const error_category & std::generic_category | ( |  | ) |
| noexcept

Error category for errno error codes.

Referenced by std::error_condition::error_condition(), std::error_condition::clear(), std::error_code::make_error_code(), and std::error_condition::make_error_condition().

## ◆ make_error_code()

error_code make_error_code | ( | errc | __e | ) |
| related

Create an error_code representing a standard errc condition.

The std::errc constants correspond to errno macros and so use the generic category.

Since
  C++11

Definition at line 304 of file system_error.

References std::generic_category().

Referenced by error_code().

## ◆ make_error_condition()

error_condition make_error_condition | ( | errc | __e | ) |
| related

Create an error_condition representing a standard errc condition.

The std::errc constants correspond to errno macros and so use the generic category.

Since
  C++11

Definition at line 437 of file system_error.

References error_condition(), and std::generic_category().

Referenced by error_condition().

## ◆ operator<<()

template<typename _CharT, typename _Traits>

basic_ostream< _CharT, _Traits > & operator<< | ( | basic_ostream< _CharT, _Traits > & | __os,
|  | const error_code & | __e )
| related

Write a std::error_code to an ostream.

Since
  C++11

Definition at line 317 of file system_error.

References operator<=>().

## ◆ operator<=>() [1/2]

strong_ordering operator<=> | ( | const error_code & | __lhs,
|  | const error_code & | __rhs )
| related

Ordered comparison for std::error_code.

This defines a total order by comparing the categories, and then if they are equal comparing the values.

Since
  C++11

Definition at line 317 of file system_error.

Referenced by operator<<().

## ◆ operator<=>() [2/2]

strong_ordering operator<=> | ( | const error_condition & | __lhs,
|  | const error_condition & | __rhs )
| related

Ordered comparison for std::error_condition.

This defines a total order by comparing the categories, and then if they are equal comparing the values.

Since
  C++11

Definition at line 499 of file system_error.

References error_condition(), and operator<=>().

Referenced by operator<=>().

## ◆ operator==() [1/3]

bool operator== | ( | const error_code & | __lhs,
|  | const error_code & | __rhs )
| related

Equality comparison for std::error_code.

Returns true only if they have the same category and the same value.

Since
  C++11

Definition at line 451 of file system_error.

## ◆ operator==() [2/3]

bool operator== | ( | const error_code & | __lhs,
|  | const error_condition & | __rhs )
| related

Equality comparison for std::error_code and std::error_condition.

Uses each category's equivalent member function to check whether the values correspond to an equivalent error in that category.

Since
  C++11

Definition at line 467 of file system_error.

References error_condition().

## ◆ operator==() [3/3]

bool operator== | ( | const error_condition & | __lhs,
|  | const error_condition & | __rhs )
| related

Equality comparison for std::error_condition.

Returns true only if they have the same category and the same value.

Since
  C++11

Definition at line 482 of file system_error.

References error_condition().

## ◆ system_category()

const error_category & std::system_category | ( |  | ) |
| noexcept

Error category for other error codes defined by the OS.

References make_error_code(), make_error_condition(), and system_category().

Referenced by system_category().

## Variable Documentation

## ◆ is_error_code_enum_v

template<typename _Tp>

bool std::is_error_code_enum_v
| inlineconstexpr

Definition at line 76 of file system_error.

## ◆ is_error_condition_enum_v

template<typename _Tp>

bool std::is_error_condition_enum_v
| inlineconstexpr

Definition at line 79 of file system_error.