std::experi...nges::tagged(3)
π NAME π
okay so welcome to the std::experi...nges::tagged(3) page from the C++ Standard Library, bestie π«Ά β we're talking about std::experimental::ranges::tagged, and it's literally the std::experimental::ranges::tagged class template. That's the name, that's the vibe, no cap β¨.
β¨ Synopsis β¨
Defined in header <experimental/ranges/utility>
template< class Base, TagSpecifier... Tags >
requires sizeof...(Tags) <= std::tuple_size<Base>::value (ranges TS)
struct tagged;
The class template tagged augments a tuple-like class type Base, which it publicly derives from, with a set of named accessors specified by the tag specifiers Tags.... The tags are applied in order: the i-th tag specifier in Tags... correspond to the i-th element of the tuple. π
bestie, the tag specifiers in Tags... shall be unique. Otherwise, the behavior is undefined π β so no duplicate tags, fr fr.
also important: it is not possible to delete an instance oftaggedthrough a pointer to any base other thanBase. periodt π
π Member functions π
constructorβ construct ataggedobject (public member function)operator=β assigns ataggedobject (public member function)swapβ swaps the contents of twotaggedobjects (public member function)
π Named element accessors π
For the N-th tag specifier in Tags... whose corresponding element name is name, tagged provides accessors named name as follows:
constexpr decltype(auto) name() & { return std::get<N>(*this); }
constexpr decltype(auto) name() const & { return std::get<N>(*this); }
constexpr decltype(auto) name() && { return std::get<N>(std::move(*this)); }
π Non-member functions π
ranges::swap(ranges::tagged)β specializesswapfortaggedobjects (function)
β¨ Tuple-like access β¨
std::tuple_size<std::experimental::ranges::tagged>β obtains the size of atagged(class template specialization)std::tuple_element<std::experimental::ranges::tagged>β obtains the types of the elements of atagged(class template specialization)
π¦ See also π¦
TagSpecifierβ specifies that a type is a tag specifier (concept)tagged_pairβ alias template for a taggedstd::pair(alias template)make_tagged_pairβ convenience function for creating atagged_pair(function template)tagged_tupleβ alias template for a taggedstd::tuple(alias template)make_tagged_tupleβ convenience function for creating atagged_tuple(function template)in,in1,in2,out,out1,out2,fun,min,max,begin,endβ tag specifiers for use withranges::tagged(class)
okay that's the whole page, bestie π source: http://cppreference.com, version: 2024.06.10, date: 2024.06.10 β mwah πβ¨
π¦ 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