std::experi...ges::tagged)(3)

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

πŸ’– std::experimental::ranges::swap(ranges::tagged) πŸ’–

okay bestie, this page is from the C++ Standard Libary manual (yes, that spelling is literally in the source, no cap), and we're talking about the ranges::tagged swap situation. it's giving niche-but-iconic πŸŽ€

✨ NAME ✨

std::experimental::ranges::swap(ranges::tagged) - std::experimental::ranges::swap(ranges::tagged)

✨ Synopsis ✨

          friend constexpr void swap( tagged& lhs, tagged& rhs )
          noexcept(noexcept(lhs.swap(rhs)))
              requires Swappable<Base>;

Swap the contents of *this and rhs, as if by lhs.swap(rhs);.

This function is not visible to ordinary unqualified or qualified lookup, and it can only be found by argument-dependent lookup when tagged is an associated class of the arguments. lowkey hidden-friend magic ✨

πŸ’… Notes πŸ’…

Unlike most non-member swaps in the standard library, this swap is a hidden friend function declared in the body of tagged, not a function template. the tagged in the function declaration is the injected-class-name. slay, C++ linguistics πŸ’€

πŸ¦‹ See also πŸ¦‹

  • swap β€” swaps the contents of two tagged objects (public member function)

and that's the tea πŸ“ source: http://cppreference.com, date: 2024.06.10, page: std::experi...ges::tagged)(3) β€” go forth and vibe with your swaps, bestie πŸ’œβœ¨

πŸ“¦ where this page comes from