std::functi...::operator=(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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 πŸ«–βœ¨

  1. Copy assignment operator is explicitly-defaulted. std::function_ref satisfies copyable and TriviallyCopyable. This defaulted assignment operator performs a shallow copy of the stored thunk-ptr and bound-entity. Slay, but make it shallow πŸ’…
  2. User-defined assignment operator is explicitly-deleted if T is not the same type as std::function_ref, std::is_pointer_v<T> is false, and T is not a specialization of std::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_ref object (C++26) (public member function) πŸ’–
  • operator= β€” assigns a new target (public member function of std::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