std::experi...tagged_tuple(3)

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

okay bestie, welcome to std::experi...tagged_tuple(3) from the C++ Standard Libary β€” yes, that's the manual name, typo and all, and we're keeping it πŸ’…βœ¨

🌸 NAME 🌸

  • std::experimental::ranges::tagged_tuple β€” the name is literally std::experimental::ranges::tagged_tuple, and the original name line is std::experimental::ranges::tagged_tuple - std::experimental::ranges::tagged_tuple. slay, that's the whole name moment 🫢

✨ Synopsis ✨

the synopsis is giving:

Defined in header <experimental/ranges/tuple>
template< TaggedType... Types >                (ranges TS)
using tagged_tuple = /* see below */;

It's the convenience alias template for naming a ranges::tagged wrapping a std::tuple.

A TaggedType is a function type S(T), where S is a TagSpecifier and T is the type of the element.

So tagged_tuple<S1(T1), ..., SN(TN)> is an alias for ranges::tagged<std::tuple<T1, ..., TN>, S1, ..., SN>. periodt πŸ’–

πŸ’– Notes πŸ’–

Because a function type is used to β€œglue” the tag specifier and the corresponding element type together, the usual parameter type adjustments apply. In particular, top-level cv-qualifiers are removed and array types are adjusted to pointers:

tagged_tuple<tag::in(const int* const), tag::out(int[])> is
ranges::tagged<std::tuple<const int*, int*>, tag::in, tag::out>.

that's the example, bestie β€” keep those consts exactly where they are πŸ‘€βœ¨

🌈 See also 🌈

  • TaggedType β€” specifies that a type represents a tag specifier and its element type (concept)
  • tagged β€” augument a tuple-like type with named accessors (class template)
  • tagged_pair β€” alias template for a tagged std::pair (alias template)
  • make_tagged_pair β€” convenience function for creating a tagged_pair (function template)
  • make_tagged_tuple β€” convenience function for creating a tagged_tuple (function template)

and the tag-specifier block from the original see-also section goes exactly like this:

in
in1
in2
out
out1              tag specifiers for use with ranges::tagged
out2              (class)
fun
min
max
begin
end

the original really says augument for tagged β€” typo and all, we keep it, because facts don't change even when spelling is iconic πŸ’€πŸ’…


that's the whole page, bestie πŸ’– source/version + date vibes: this one's from http://cppreference.com, dated 2024.06.10, and it's literally std::experi...tagged_tuple(3). go forth and tag those tuples πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from