std::functi...::operator=(3)
π hiii bestie!! welcome to std::functi...::operator=(3) from the C++ Standard Libary β yes, that's the manual name, typo and all, we're keeping it π
πΈ NAME πΈ
std::function_ref::operator= β std::function_ref::operator= β that's the name, bestie, and it's lowkey iconic π
π Synopsis π
constexpr function_ref& operator=( const function_ref& ) noexcept
(1) (since C++26)
= default;
template< class T >
(2) (since C++26)
constexpr function_ref& operator=( T ) = delete;
okay so here's the tea π«β¨
- Copy assignment operator is explicitly-defaulted.
std::function_refsatisfiescopyableandTriviallyCopyable. This defaulted assignment operator performs a shallow copy of the storedthunk-ptrandbound-entity. Slay, but make it shallow π - User-defined assignment operator is explicitly-deleted if
Tis not the same type asstd::function_ref,std::is_pointer_v<T>is false, andTis not a specialization ofstd::nontype_t. This overload participates in overload resolution only if the constraints are satisfied in the conditions above. No cap, it's giving very "read the constraints" energy π₯
π Return value π
It's literally *this. That's it. That's the return value, bestie π
π See also π
- constructor β constructs a new
function_refobject (C++26) (public member function) π operator=β assigns a new target (public member function ofstd::function<R(Args...)>) β¨
xoxo π your source/version is http://cppreference.com and the date is 2024.06.10 β catch you in the next manpage, bestie π«Άβ¨
π¦ 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