std::refere...r::operator=(3)
π std::refere...r::operator=(3) π
Ok bestie, we're in the C++ Standard Libary manual today and the main character is std::reference_wrapper::operator=. Yes, that's the title. We're doing this. π«Ά
πΈ NAME πΈ
std::reference_wrapper::operator= β std::reference_wrapper::operator= β¨
(Yes, same thing twice. It's giving "the function so iconic they named it twice." π )
π¦ Synopsis π¦
Here's the signature exactly as the page lays it out β copy assignment energy, since C++11, and constexpr since C++20:
reference_wrapper& operator=( const reference_wrapper& (since
C++11)
other ) noexcept;
(constexpr since C++20)
Okay so this is the Copy assignment operator. It drops the current reference and stores a reference to other.get(). That's the whole vibe. π₯
π Parameters π
otherβ reference wrapper to copy. That's it. That's the parameter. π
π Return value π
*thisβ yup, it returns itself. Main character returns main character. π
Source/version and date, as promised: this page comes from http://cppreference.com, version 2024.06.10, and the footer date is 2024.06.10. Byeee, go copy-assign something cute πβ¨
π¦ 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