std::error_...n::operator=(3)
π std::error_...n::operator=(3) β from the C++ Standard Libary manual, bestie π
πΈ NAME πΈ
std::error_condition::operator= β literally std::error_condition::operator=. Thatβs the whole name, no cap π
.
β¨ Synopsis β¨
Okay so hereβs the exact code vibe, bestie β overloads numbered (1), (2), (3), all since C++11:
template< class ErrorConditionEnum >
error_condition& operator=( ErrorConditionEnum e ) (1) (since
C++11)
noexcept;
error_condition& operator=( const error_condition& other ) (2) (since
C++11)
= default;
(implicitly declared)
error_condition& operator=( error_condition&& other ) = (3) (since
C++11)
default;
(implicitly declared)
π Description π
Assigns contents to an error condition. Thatβs the main-character sentence, and hereβs the breakdown:
- Assigns error condition for enum
e. Effectively callsmake_error_conditionthat is only found by argument-dependent lookup foreand then replaces*thiswith the result. This overload participates in overload resolution only ifstd::is_error_condition_enum<ErrorConditionEnum>::valueis true.
2,3. Implicitly defined copy-assignment operator and move-assignment operator assign the contents of other to *this.
π«Ά Parameters π«Ά
eβ error condition enumotherβ another error condition to assign with
π Return value π
Returns *this. Short, sweet, iconic β¨.
π©Ή Defect reports π©Ή
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- DR:
LWG 3629 - Applied to: C++11
- Behavior as published: only
std::make_error_conditionoverloads were used - Correct behavior: ADL-found overloads are used
π source/version + date sign-off: this page came from http://cppreference.com, dated 2024.06.10, and itβs the std::error_...n::operator=(3) page. 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