std::iter_v...eference_t,(3)
π NAME π
bestie, welcome to the std::iter_v...eference_t,(3) page from the C++ Standard Libary manual β¨
std::iter_value_t, std::iter_reference_t, std::iter_const_reference_t β std::iter_value_t,std::iter_reference_t,std::iter_const_reference_t, π
β¨ SYNOPSIS β¨
Defined in header <iterator>
template< class T >
(exposition
concept /*dereferenceable*/ = /* see below */;
only*)
template< class T > (1)
(since C++20)
using iter_value_t = /* see below */;
template< /*dereferenceable*/ T > (2)
(since C++20)
using iter_reference_t = decltype(*std::declval<T&>());
template< std::indirectly_readable T >
using iter_const_reference_t = std::common_reference_t<const
std::iter_value_t<T>&&, (3)
(since C++23)
std::iter_reference_t<T>>;
template< class T > (4)
(since C++20)
using iter_difference_t = /* see below */;
template< /*dereferenceable*/ T>
requires /* see below */ (5)
(since C++20)
using iter_rvalue_reference_t =
decltype(ranges::iter_move(std::declval<T&>()));
template< std::indirectly_readable T >
using iter_common_reference_t =
std::common_reference_t<std::iter_reference_t<T>, (6)
(since C++20)
std::iter_value_t<T>&>;
πΈ DESCRIPTION πΈ
okay so these aliases compute the associated types of an iterator, and that's literally the whole vibe π«Ά
There's an exposition-only concept, /*dereferenceable*/, and it's satisfied if and only if the expression *std::declval<T&>() is valid and has a referenceable type (in particular, not void). periodt π
- Computes the value type of
T. Ifstd::iterator_traits<std::remove_cvref_t<T>>is not specialized, thenstd::iter_value_t<T>isstd::indirectly_readable_traits<std::remove_cvref_t<T>>::value_type. Otherwise, it isstd::iterator_traits<std::remove_cvref_t<T>>::value_type. - Computes the reference type of
T. - Computes the const reference type of
T. - Computes the difference type of
T. Ifstd::iterator_traits<std::remove_cvref_t<T>>is not specialized, thenstd::iter_difference_t<T>isstd::incrementable_traits<std::remove_cvref_t<T>>::difference_type. Otherwise, it isstd::iterator_traits<std::remove_cvref_t<T>>::difference_type. - Computes the rvalue reference type of
T. The"see below"portion of the constraint on this alias template is satisfied if and only if the expressionranges::iter_move(std::declval<T&>())is valid and has a referenceable type (in particular, notvoid). - Computes the common reference type of
T. This is the common reference type between its reference type and an lvalue reference to its value type.
π¦ SEE ALSO π¦
indirectly_readable(C++20) β specifies that a type is indirectly readable by applyingoperator *(concept) πweakly_incrementable(C++20) β specifies that a semiregular type can be incremented with pre- and post-increment operators (concept) π₯indirectly_readable_traits(C++20) β computes the value type of an indirectly_readable type (class template) πincrementable_traits(C++20) β computes the difference type of a weakly_incrementable type (class template) βiterator_traitsβ provides uniform interface to the properties of an iterator (class template) π
that's the whole page, bestie! source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::iter_v...eference_t,(3) β 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