std::error_code
Contents
Constructor & Destructor Documentation
template<typename_ErrorCodeEnum,typename=_Check<_ErrorCodeEnum>>std::error_code::error_code(_ErrorCodeEnum__e)[inline],[noexcept]
Initialize with a user-defined type, by calling make_error_code.
Detailed Description
Class error_code
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.
An error_code 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 errno 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.
Since
C++11
Member Function Documentation
consterror_category&std::error_code::category()const[inline],[noexcept]
The error category that this error belongs to.
error_conditionstd::error_code::default_error_condition()const[noexcept]
An error_condition for this error's category and value.
stringstd::error_code::message()const[inline]
The category's description of the value.
std::error_code::operatorbool()const[inline],[explicit],[noexcept]
Test whether value() is non-zero.
intstd::error_code::value()const[inline],[noexcept]
The error value.
Name
std::error_code
Synopsis
#include <system_error>
PublicMemberFunctions
template<typename_ErrorCodeEnum , typename = _Check<_ErrorCodeEnum>> error_code (_ErrorCodeEnum __e)
noexcept
Initialize with a user-defined type, by calling make_error_code.
error_code (const error_code &)=defaulterror_code (int __v, const error_category &__cat) noexcept
voidassign (int __v, const error_category &__cat) noexcept
const error_category & category () const noexcept
The error category that this error belongs to.
voidclear () noexcept
error_conditiondefault_error_condition () const noexcept
An error_condition for this error's category and value.
stringmessage () const
The category's description of the value.
operatorbool () const noexcept
Test whether value() is non-zero.
error_code & operator= (const error_code &)=default
int value () const noexcept
The error value.
RelatedSymbols
(Note that these are not member symbols.)
error_codemake_error_code (errc __e) 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_code &__lhs, const error_code &__rhs) noexcept
template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & operator<<
(basic_ostream< _CharT, _Traits > &__os, const error_code &__e)
