std::experi...gged::tagged(3)
π 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 ofBase. free real estate, we love an inheritance moment π(2),(3),(4)βtaggedhas defaulted default, copy, and move constructors that invoke the corresponding constructor ofBase. all defaulted, all chill, zero drama β¨(5)β converting move constructor fromBase. it initializes theBasesubobject withstd::move(that). yes queen, move it πββοΈπ¨(6)β converting copy constructor fromBase. initializes theBasesubobject withthat. a gentle little copy, respect π(7)β converting move constructor from a differenttaggedspecialization with matching tags. initializes theBasesubobject withstatic_cast<Other&&>(that). cross-specialization but the tags match so it's fine, iykyk π₯(8)β converting copy constructor from a differenttaggedspecialization with matching tags. initializes theBasesubobject withstatic_cast<const Other&>(that). copy version of the same energy, periodt π
ngl thenoexcept(...)clauses andrequiresconstraints 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
- 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