std::experi..._tagged_pair(3)

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

okay so welcome to the std::experi..._tagged_pair(3) page from the C++ Standard Libary manual πŸ’… this one is short and cute, but every detail still matters, bestie.


🌸 NAME 🌸

std::experimental::ranges::make_tagged_pair β€” std::experimental::ranges::make_tagged_pair

Yes, it literally says it twice. Iconic behavior. πŸŽ€

✨ Synopsis ✨

Defined in header <experimental/ranges/utility>.

template< TagSpecifier Tag1, TagSpecifier Tag2, class T1, class T2 >
constexpr ranges::tagged</*see below*/, Tag1, Tag2> make_tagged_pair(
(ranges TS)
T1&& x, T2&& y );

So this is the ranges TS situation, and it's the convenience function for creating a tagged pair. It deduces the element types from the arguments, but the tag specifiers must be explicitly specified β€” no sneaky auto-deduction for those, iykyk. πŸ¦‹

The /*see below*/ part of the return type is literally:

decltype(std::make_pair(std::forward<T1>(x), std::forward<T2>(y)))

That's the whole "see below" mystery. Slay. πŸ”₯

πŸ’– Return value πŸ’–

It returns R(std::forward<T1>(x), std::forward<T2>(y)), where R is the return type. That's the return-value moment, no cap. ✨

πŸ”₯ 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).
  • tagged_tuple β€” alias template for a tagged std::tuple (alias template).
  • make_tagged_tuple β€” convenience function for creating a tagged_tuple (function template).
  • in, in1, in2, out, out1, out2, fun, min, max, begin, end β€” tag specifiers for use with ranges::tagged (class).

πŸ’– That's the page, bestie! Source/version: http://cppreference.com; date: 2024.06.10; page: std::experi..._tagged_pair(3). Bye! πŸ’–

πŸ“¦ where this page comes from