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

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

πŸ’… std::experi...gged::tagged πŸ’…

okay so bestie, grab a strawberry drink πŸ“ because we're reading the std::experi...gged::tagged(3) page from the C++ Standard Library manual β€” yes, the whole manual name is right there in the title and it's a mouthful, no cap 😭


✨ NAME ✨

std::experimental::ranges::tagged::tagged β€” literally just the constructor of tagged, being its own whole NAME section. iconic. πŸ‘‘


🌸 SYNOPSIS 🌸

okay so here's the whole overload lineup, and I'm keeping it exactly as-is because this is sacred text 🫢

(1)

using Base::Base;

(2)

tagged() = default;

(3)

tagged( tagged&& that ) = default;

(4)

tagged( const tagged& that ) = default;

(5)

tagged( Base&& that )
noexcept(std::is_nothrow_move_constructible<Base>::value)
      requires MoveConstructible<Base>;

(6)

tagged( const Base& that )
noexcept(std::is_nothrow_copy_constructible<Base>::value)
      requires CopyConstructible<Base>;

(7)

template< class Other >
    requires Constructible<Base, Other>
constexpr tagged( ranges::tagged<Other, Tags...> && that )
    noexcept(std::is_nothrow_constructible<Base, Other>::value);

(8)

template< class Other >
    requires Constructible<Base, const Other&>
constexpr tagged( const ranges::tagged<Other, Tags...> &that );

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it do? it constructs a tagged object. that's the whole vibe check βœ…

  • (1) β€” tagged<Base, Tags...> inherits the constructors of Base. free real estate, we love an inheritance moment πŸ’–
  • (2), (3), (4) β€” tagged has defaulted default, copy, and move constructors that invoke the corresponding constructor of Base. all defaulted, all chill, zero drama ✨
  • (5) β€” converting move constructor from Base. it initializes the Base subobject with std::move(that). yes queen, move it πŸƒβ€β™€οΈπŸ’¨
  • (6) β€” converting copy constructor from Base. initializes the Base subobject with that. a gentle little copy, respect πŸ™ˆ
  • (7) β€” converting move constructor from a different tagged specialization with matching tags. initializes the Base subobject with static_cast<Other&&>(that). cross-specialization but the tags match so it's fine, iykyk πŸ”₯
  • (8) β€” converting copy constructor from a different tagged specialization with matching tags. initializes the Base subobject with static_cast<const Other&>(that). copy version of the same energy, periodt πŸ’…
ngl the noexcept(...) clauses and requires constraints in the synopsis are not decorative β€” they're literally part of each overload's signature, so don't go dropping them πŸ™

πŸŽ€ a cute little sign-off πŸŽ€

that's the whole page, bestie β€” source is cppreference.com and the version/date stamp on this one is 2024.06.10, so if you're citing it in a group chat, that's your receipt πŸ§ΎπŸ’œ

now go forth and construct your tagged objects with main character energy πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from