std::error_code(3cxx)
std::error_code π
(from the 3cxx manual, libstdc++ edition)
okay bestie, welcome to std::error_code β it's giving main character energy in the 3cxx manual, and we're gonna get through every signature together π«Άβ¨
π NAME π
std::error_code β that's the name, no cap.
β¨ SYNOPSIS β¨
#include <system_error>
π«Ά Public Member Functions π«Ά
template<typename _ErrorCodeEnum , typename = _Check<_ErrorCodeEnum>>error_code (_ErrorCodeEnum __e) noexceptβ Initialize with a user-defined type, by callingmake_error_code.error_code (const error_code &)=defaultβ defaulted, periodt.error_code (int __v, const error_category &__cat) noexceptβ constructor with__vand__cat, exactly like the signature says.void assign (int __v, const error_category &__cat) noexceptβ assign time, bestie.const error_category & category () const noexceptβ The error category that this error belongs to.void clear () noexceptβ clear it out, that's the whole signature.error_condition default_error_condition () const noexceptβ Anerror_conditionfor this error's category and value.string message () constβ The category's description of the value.operator bool () const noexceptβ Test whethervalue()is non-zero.error_code & operator= (const error_code &)=defaultβ defaulted assignment vibe.int value () const noexceptβ The error value.
π Related Symbols π
Note that these are not member symbols. iykyk π«Ά
error_code make_error_code (errc __e) noexceptβ related symbol, not a member, obviously.strong_ordering operator (const error_code &__lhs, const error_code &__rhs) noexceptβ related symbol, not a member.template<typename _CharT , typename _Traits > basic_ostream< _CharT, _Traits > & operator<< (basic_ostream< _CharT, _Traits > &__os, const error_code &__e)β related symbol, not a member.
π¦ Detailed Description π¦
πͺ© Class error_code πͺ©
Okay so error_code 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. (yes, I kept the double βthe theβ exactly β character-for-character energy π
)
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 β the era, the moment, the standard, bestie.
π§ 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 callingmake_error_code.- References
make_error_code().
- References
π Member Function Documentation π
const error_category & std::error_code::category () const [inline],[noexcept]β The error category that this error belongs to.- Referenced by
message().
- Referenced by
error_condition std::error_code::default_error_condition () const [noexcept]β Anerror_conditionfor this error's category and value.string std::error_code::message () const [inline]β The category's description of the value.- References
category(), andvalue().
- References
std::error_code::operator bool () const [inline], [explicit], [noexcept]β Test whethervalue()is non-zero.int std::error_code::value () const [inline], [noexcept]β The error value.- Referenced by
message().
- Referenced by
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
okay that's the whole page, bestie! π The footer energy is source/version libstdc++ and page std::error_code(3cxx); there's no date printed in the footer text here, so I'm not inventing one β periodt π«Άβ¨
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms