std::error_...or_condition(3)
π std::error_condition::error_condition
okay bestie, welcome to the C++ Standard Library page for std::error_condition::error_condition β yes the constructor, yes it's named after its own class twice, that's just how this house does it π (and yeah, the page header calls it std::error_...or_condition(3) because terminals are dramatic and truncate things, love that for us).
β¨ SYNOPSIS β¨
error_condition() noexcept; (1) (since C++11)
error_condition( int val, const error_category& cat ) (2) (since C++11)
noexcept;
template< class ErrorConditionEnum > (3) (since C++11)
error_condition( ErrorConditionEnum e ) noexcept;
error_condition( const error_condition& other ) = default; (4) (since C++11)
(implicitly declared)
error_condition( error_condition&& other ) = default; (5) (since C++11)
(implicitly declared)
Constructs a new error condition. iconic behaviour tbh π
πΈ DESCRIPTION πΈ
So here's what each overload is giving:
- Default constructor. Initializes the error condition with the generic category and error value
0. the "no thoughts, head empty" of error conditions π«§ - Initializes the error condition with error value
valand error categorycat. you pick the numbers, you pick the vibes. - Initializes the error condition with enum
e. Effectively callsmake_error_conditionthat is only found by argument-dependent lookup fore. This overload participates in overload resolution only ifstd::is_error_condition_enum<ErrorConditionEnum>::valueistrue. (very "iykyk", very ADL β¨) - Implicitly defined copy constructor and move constructor (that's 4 and 5, together, besties). Initializes the error condition with the contents of
other.
π¦ PARAMETERS π¦
otherβ another error condition to initialize withvalβ error valuecatβ error categoryeβ error condition enum
π DEFECT REPORTS π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards. (yes, they went back and fixed it, no cap, that's genuinely main character energy π)
LWG 3629β Applied to: C++11- Behavior as published: only
std::make_error_conditionoverloads were used - Correct behavior: ADL-found overloads are used
- Behavior as published: only
π SEE ALSO π
make_error_condition(std::errc)(since C++11) β creates an error condition for anerrcvalue (function)make_error_condition(std::io_errc)(since C++11) β constructs an iostream error condition (function)make_error_condition(std::future_errc)(since C++11) β constructs a futureerror_condition(function)
okay that's the whole page, you ate that π no notes. this little masterpiece is from cppreference.com, dated 2024.06.10, and it lives at std::error_...or_condition(3) β go forth and construct your error conditions responsibly, mwah ππ§
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms