.TH "std::error_code" 3cxx "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<\fBtypename\fP \fB_ErrorCodeEnum\fP , \fBtypename\fP = typename enable_if::value>::type> \fBerror_code\fP (\fB_ErrorCodeEnum\fP __e) noexcept" .br .ti -1c .RI "\fBerror_code\fP (int \fB__v\fP, const \fBerror_category\fP &\fB__cat\fP) noexcept" .br .ti -1c .RI "\fBvoid\fP \fBassign\fP (int \fB__v\fP, const \fBerror_category\fP &\fB__cat\fP) 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 "\fBvoid\fP \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<\fBtypename\fP \fB_ErrorCodeEnum\fP > \fBenable_if\fP< \fBis_error_code_enum\fP< \fB_ErrorCodeEnum\fP >\fB::value\fP, \fBerror_code\fP & >::type \fBoperator=\fP (\fB_ErrorCodeEnum\fP __e) noexcept" .br .ti -1c .RI "int \fBvalue\fP () const noexcept" .br .RI "The error value\&. " .in -1c .SS "Related Symbols" (Note that these are not member symbols\&.) .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 &\fB__lhs\fP, const \fBerror_code\fP &\fB__rhs\fP) noexcept" .br .ti -1c .RI "bool \fBoperator!=\fP (const \fBerror_code\fP &\fB__lhs\fP, const \fBerror_condition\fP &\fB__rhs\fP) noexcept" .br .ti -1c .RI "bool \fBoperator<\fP (const \fBerror_code\fP &\fB__lhs\fP, const \fBerror_code\fP &\fB__rhs\fP) noexcept" .br .ti -1c .RI "template<\fBtypename\fP _CharT , \fBtypename\fP _Traits > \fBbasic_ostream\fP< _CharT, _Traits > & \fBoperator<<\fP (\fBbasic_ostream\fP< _CharT, _Traits > &\fB__os\fP, 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\&.