---
name: "std::error_condition"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::error_condition"
---

# std::error\_condition(3)

## NAME

std::error\_condition

## SYNOPSIS

\#include \<system\_error\>

### Public Member Functions

**error\_condition** () noexcept\
 Initialize with a zero (no error) value and the generic category.  template\<typename \_ErrorConditionEnum, typename = \_Check\<\_ErrorConditionEnum\>\> **error\_condition** (\_ErrorConditionEnum \_\_e) noexcept\
 Initialize with a user-defined type, by calling make\_error\_condition.  **error\_condition** (const error\_condition &)=default\
 **error\_condition** (int \_\_v, const **error\_category** &\_\_cat) noexcept\
 Initialize with the specified value and category.  void **assign** (int \_\_v, const **error\_category** &\_\_cat) noexcept\
 Set the value and category.  const **error\_category** & **category** () const noexcept\
 The error category that this error belongs to.  void **clear** () noexcept\
 Reset the value and category to the default-constructed state.  **string** **message** () const\
 The category's description of the value.  **operator bool** () const noexcept\
 Test whether value() is non-zero.  **error\_condition** & **operator=** (const **error\_condition** &)=default\
 int **value** () const noexcept\
 The error value.

### 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

## Constructor & Destructor Documentation

### std::error\_condition::error\_condition () \[inline\], \[noexcept\]

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

References **std::generic\_category()**.

Referenced by **make\_error\_condition()**, **operator\<=\>()**, **operator==()**, and **operator==()**.

### std::error\_condition::error\_condition (int \_\_v, const error\_category & \_\_cat) \[inline\], \[noexcept\]

Initialize with the specified value and category.

### template\<typename \_ErrorConditionEnum, typename = \_Check\<\_ErrorConditionEnum\>\> std::error\_condition::error\_condition (\_ErrorConditionEnum \_\_e) \[inline\], \[noexcept\]

Initialize with a user-defined type, by calling make\_error\_condition.

References **make\_error\_condition()**.

## Member Function Documentation

### void std::error\_condition::assign (int \_\_v, const error\_category & \_\_cat) \[inline\], \[noexcept\]

Set the value and category.

Referenced by **clear()**.

### const error\_category & std::error\_condition::category () const \[inline\], \[noexcept\]

The error category that this error belongs to.

Referenced by **message()**.

### void std::error\_condition::clear () \[inline\], \[noexcept\]

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

References **assign()**, and **std::generic\_category()**.

### string std::error\_condition::message () const \[inline\]

The category's description of the value.

References **category()**, **std::error\_category::message()**, and **value()**.

### std::error\_condition::operator bool () const \[inline\], \[explicit\], \[noexcept\]

Test whether value() is non-zero.

### int std::error\_condition::value () const \[inline\], \[noexcept\]

The error value.

Referenced by **message()**.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
