std::experi...tagged_pair(3)
hey bestie, welcome to the std::experi...tagged_pair(3) page π«Ά β manual name? C++ Standard Libary (yes, that's the spelling, leave it alone π
). It's giving C++ standard library template energy, and we're gonna get you comfy with it.
πΈ NAME πΈ
std::experimental::ranges::tagged_pair β the short description is literally std::experimental::ranges::tagged_pair again. Self-titled icon behavior, no cap. π
β¨ Synopsis β¨
okay so this thing is defined in header <experimental/ranges/utility>.
Here's the exact synopsis, bestie:
template< TaggedType T1, TaggedType T2 > (ranges TS)
using tagged_pair = /* see below */;
It's a convenience alias template for naming a ranges::tagged wrapping a std::pair β¨.
A TaggedType is a function type S(T), where S is a TagSpecifier and T is the type of the element. Keep that in your notes fr fr.
So:
tagged_pair<S1(T1), S2(T2)>
is an alias for:
ranges::tagged<std::pair<T1, T2>, S1, S2>
slay, that's the whole alias situation. π
π Notes π
β οΈ caveat time, bestie β read this before you get too comfy.
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_pair<tag::in(const int* const), tag::out(int[])>
is:
ranges::tagged<std::pair<const int*, int*>, tag::in, tag::out>
so yeah, the function-type glue has consequences. Not me warning you about type adjustments π.
π See also π
okay here's the friend group / linked-reference section π«Ά:
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). (yes, "augument" is what the page says, I'm not fixing their spelling π)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).
xoxo, super cute sign-off time: source is http://cppreference.com, version/date is 2024.06.10, and the footer title is std::experi...tagged_pair(3). bestie, go forth and tag ur pairs π
π
π¦ 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