std::experi...reference_t,(3)

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

Hey bestie πŸ’– welcome to the std::experi...reference_t,(3) page from the C++ Standard Libary manual. It's giving niche C++ ranges TS realness, and we're gonna keep every crumb.

🌸 NAME 🌸

Ok so the names on this page are exactly these, comma chaos and all:

std::experimental::ranges::reference_t,std::experimental::ranges::rvalue_reference_t,
-
std::experimental::ranges::reference_t,std::experimental::ranges::rvalue_reference_t,

That's the NAME block, bestie. The - is literally in there too. No edits, no cap.

✨ Synopsis ✨

This whole thing is Defined in header <experimental/ranges/iterator> β€” iconic header, noted. Here's the synopsis exactly as it appears, including the exposition-only concept and the (1)/(2)/(3) labels:

Defined in header <experimental/ranges/iterator>
template< class T >
(exposition
concept bool /*dereferenceable*/ = requires(T& t) { {*t} -> auto&&;
only*)
};
template< /*dereferenceable*/ T >
(1) (ranges TS)
using reference_t = decltype(*declval<T&>());
template< /*dereferenceable*/ T >

requires requires(T& t) { { ranges::iter_move(t) } -> auto&&; }
(2) (ranges TS)

using rvalue_reference_t =
decltype(ranges::iter_move(declval<T&>()));
template< Readable T >

using iter_common_reference_t =
ranges::common_reference_t<ranges::reference_t<T>,
(3) (ranges TS)

ranges::value_type_t<T>&>;

Let's break down the numbered moments, because they're the main character energy:

  1. Obtain the reference type of a dereferenceable type T.
  2. Obtain the rvalue reference type of a dereferenceable type T, that is, the return type of ranges::iter_move.
  3. Compute a Readable type's common reference type. This is the common reference type of its reference type and an lvalue reference to its value type.

πŸ’œ Notes πŸ’œ

Small but important note: the -> auto&& constraint checks that the type of the expression is not void. That's the vibe check right there. πŸ’…


Okay that's the whole page, bestie 🫢. Source/version/date tea: http://cppreference.com, 2024.06.10, std::experi...reference_t,(3). Byeeee βœ¨πŸ’–

πŸ“¦ where this page comes from