.TH "std::error_code" 3cxx "Tue Jun 13 2023" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::error_code .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "template::value>::type> \fBerror_code\fP (_ErrorCodeEnum __e) noexcept" .br .ti -1c .RI "\fBerror_code\fP (int __v, const \fBerror_category\fP &__cat) noexcept" .br .ti -1c .RI "void \fBassign\fP (int __v, const \fBerror_category\fP &__cat) noexcept" .br .ti -1c .RI "const \fBerror_category\fP & \fBcategory\fP () const noexcept" .br .RI "The error category that this error belongs to\&. " .ti -1c .RI "void \fBclear\fP () noexcept" .br .ti -1c .RI "\fBerror_condition\fP \fBdefault_error_condition\fP () const noexcept" .br .RI "An \fCerror_condition\fP for this error's category and value\&. " .ti -1c .RI "\fBstring\fP \fBmessage\fP () const" .br .RI "The category's description of the value\&. " .ti -1c .RI "\fBoperator bool\fP () const noexcept" .br .RI "Test whether \fCvalue()\fP is non-zero\&. " .ti -1c .RI "template \fBenable_if\fP< \fBis_error_code_enum\fP< _ErrorCodeEnum >\fB::value\fP, \fBerror_code\fP & >::type \fBoperator=\fP (_ErrorCodeEnum __e) noexcept" .br .ti -1c .RI "int \fBvalue\fP () const noexcept" .br .RI "The error value\&. " .in -1c .SS "Related Functions" (Note that these are not member functions\&.) .in +1c .ti -1c .RI "\fBerror_code\fP \fBmake_error_code\fP (errc __e) noexcept" .br .ti -1c .RI "bool \fBoperator!=\fP (const \fBerror_code\fP &__lhs, const \fBerror_code\fP &__rhs) noexcept" .br .ti -1c .RI "bool \fBoperator!=\fP (const \fBerror_code\fP &__lhs, const \fBerror_condition\fP &__rhs) noexcept" .br .ti -1c .RI "bool \fBoperator<\fP (const \fBerror_code\fP &__lhs, const \fBerror_code\fP &__rhs) noexcept" .br .ti -1c .RI "template \fBbasic_ostream\fP< _CharT, _Traits > & \fBoperator<<\fP (\fBbasic_ostream\fP< _CharT, _Traits > &__os, const \fBerror_code\fP &__e)" .br .in -1c .SH "Detailed Description" .PP Class error_code .PP This class is a value type storing an integer error number and a category that gives meaning to the error number\&. Typically this is done close the the point where the error happens, to capture the original error value\&. .PP An \fCerror_code\fP object can be used to store the original error value emitted by some subsystem, with a category relevant to the subsystem\&. For example, errors from POSIX library functions can be represented by an \fCerrno\fP value and the 'generic' category, but errors from an HTTP library might be represented by an HTTP response status code (e\&.g\&. 404) and a custom category defined by the library\&. .PP \fBSince\fP .RS 4 C++11 .RE .PP .SH "Member Function Documentation" .PP .SS "const \fBerror_category\fP & std::error_code::category () const\fC [inline]\fP, \fC [noexcept]\fP" .PP The error category that this error belongs to\&. .SS "\fBerror_condition\fP std::error_code::default_error_condition () const\fC [noexcept]\fP" .PP An \fCerror_condition\fP for this error's category and value\&. .SS "\fBstring\fP std::error_code::message () const\fC [inline]\fP" .PP The category's description of the value\&. .SS "std::error_code::operator bool () const\fC [inline]\fP, \fC [explicit]\fP, \fC [noexcept]\fP" .PP Test whether \fCvalue()\fP is non-zero\&. .SS "int std::error_code::value () const\fC [inline]\fP, \fC [noexcept]\fP" .PP The error value\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.