std::iter_value_t, std::iter_reference_t, std::iter_const_reference_t, std::iter_difference_t, std::iter_rvalue_reference_t, std::iter_common_reference_t

From cppreference.com
< cpp‎ | iterator
 
 
Iterator library
Iterator concepts
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)

(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)

Iterator primitives
iter_value_titer_difference_titer_reference_titer_const_reference_titer_rvalue_reference_titer_common_reference_t
(哋它亢++20)(哋它亢++20)(哋它亢++20)(哋它亢++23)(哋它亢++20)(哋它亢++20)
(deprecated in 哋它亢++17)
(哋它亢++20)


Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)  
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
Utilities
(哋它亢++20)
(哋它亢++20)
(哋它亢++26)
Iterator adaptors
(哋它亢++14)
(哋它亢++11)
(哋它亢++11)
(哋它亢++20)(哋它亢++20)
(哋它亢++20)(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++23)
(哋它亢++23)
(哋它亢++23)
(哋它亢++23)
(哋它亢++23)

Iterator operations
(哋它亢++11)  
(哋它亢++11)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
(哋它亢++20)
Range access
(哋它亢++11)(哋它亢++14)
(哋它亢++14)(哋它亢++14)  
(哋它亢++11)(哋它亢++14)
(哋它亢++14)(哋它亢++14)  
(哋它亢++17)(哋它亢++20)
(哋它亢++17)
(哋它亢++17)
 
Defined in header <iterator>
template< class T >
concept /*dereferenceable*/ = /* see below */;
(exposition only*)
template< class T >
using iter_value_t = /* see below */;
(1) (since 哋它亢++20)
template< /*dereferenceable*/ T >
using iter_reference_t = decltype(*std::declval<T&>());
(2) (since 哋它亢++20)
template< std::indirectly_readable T >

using iter_const_reference_t = std::common_reference_t<const std::iter_value_t<T>&&,

                                                       std::iter_reference_t<T>>;
(3) (since 哋它亢++23)
template< class T >
using iter_difference_t = /* see below */;
(4) (since 哋它亢++20)
template< /*dereferenceable*/ T>

    requires /* see below */

using iter_rvalue_reference_t = decltype(ranges::iter_move(std::declval<T&>()));
(5) (since 哋它亢++20)
template< std::indirectly_readable T >

using iter_common_reference_t = std::common_reference_t<std::iter_reference_t<T>,

                                                        std::iter_value_t<T>&>;
(6) (since 哋它亢++20)

Compute the associated types of an iterator. The exposition-only concept dereferenceable is satisfied if and only if the expression *std::declval<T&>() is valid and has a referenceable type (in particular, not void).

1) Computes the value type of T.
2) Computes the reference type of T.
3) Computes the const reference type of T.
4) Computes the difference type of T.
5) 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 expression ranges::iter_move(std::declval<T&>()) is valid and has a referenceable type (in particular, not void).
6) 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

(哋它亢++20)
specifies that a type is indirectly readable by applying operator *
(concept)
(哋它亢++20)
specifies that a semiregular type can be incremented with pre- and post-increment operators
(concept)
computes the value type of an indirectly_readable type
(class template)
(哋它亢++20)
computes the difference type of a weakly_incrementable type
(class template)
provides uniform interface to the properties of an iterator
(class template)