libstdc++: std::error_condition Class Reference

libstdc++

std::error_condition Class Reference
Diagnostics

`#include <system_error>`

## Public Member Functions
| error_condition () noexcept
template<typename _ErrorConditionEnum, typename = _Check<_ErrorConditionEnum>>
| error_condition (_ErrorConditionEnum __e) noexcept
| error_condition (const error_condition &)=default
| error_condition (int __v, const error_category &__cat) noexcept
void | assign (int __v, const error_category &__cat) noexcept
const error_category & | category () const noexcept
void | clear () noexcept
string | message () const
| operator bool () const noexcept
error_condition & | operator= (const error_condition &)=default
int | value () const noexcept

## Related Symbols
(Note that these are not member symbols.)
error_condition | make_error_condition (errc __e) 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

## Detailed Description

Class error_condition

This class represents error conditions that may be visible at an API boundary. Different error_code values that can occur within a library or module might map to the same error_condition.

An error_condition represents something that the program can test for, and subsequently take appropriate action.

Since
  C++11

Definition at line 356 of file system_error.

## Constructor & Destructor Documentation

## ◆ error_condition() [1/3]

std::error_condition::error_condition | ( |  | ) |
| inlinenoexcept

Initialize with a zero (no error) value and the generic category.

Definition at line 363 of file system_error.

References std::generic_category().

Referenced by make_error_condition(), operator<=>(), operator==(), and operator==().

## ◆ error_condition() [2/3]

std::error_condition::error_condition | ( | int | __v,
|  | const error_category & | __cat )
| inlinenoexcept

Initialize with the specified value and category.

Definition at line 367 of file system_error.

## ◆ error_condition() [3/3]

template<typename _ErrorConditionEnum, typename = _Check<_ErrorConditionEnum>>

std::error_condition::error_condition | ( | _ErrorConditionEnum | __e | ) |
| inlinenoexcept

Initialize with a user-defined type, by calling make_error_condition.

Definition at line 373 of file system_error.

References make_error_condition().

## Member Function Documentation

## ◆ assign()

void std::error_condition::assign | ( | int | __v,
|  | const error_category & | __cat )
| inlinenoexcept

Set the value and category.

Definition at line 384 of file system_error.

Referenced by clear().

## ◆ category()

const error_category & std::error_condition::category | ( |  | ) | const
| inlinenoexcept

The error category that this error belongs to.

Definition at line 405 of file system_error.

Referenced by message().

## ◆ clear()

void std::error_condition::clear | ( |  | ) |
| inlinenoexcept

Reset the value and category to the default-constructed state.

Definition at line 392 of file system_error.

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

## ◆ message()

string std::error_condition::message | ( |  | ) | const
| inline

The category's description of the value.

Definition at line 410 of file system_error.

References category(), std::error_category::message(), and value().

## ◆ operator bool()

std::error_condition::operator bool | ( |  | ) | const
| inlineexplicitnoexcept

Test whether value() is non-zero.

Definition at line 415 of file system_error.

## ◆ value()

int std::error_condition::value | ( |  | ) | const
| inlinenoexcept

The error value.

Definition at line 400 of file system_error.

Referenced by message().

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

- system_error