std::iterator_traits
Defined in header <iterator>
|
||
template< class Iter > struct iterator_traits; |
||
template< class T > struct iterator_traits<T*>; |
||
template< class T > struct iterator_traits<const T*>; |
(removed in C++20) | |
std::iterator_traits
is the type trait class that provides uniform interface to the properties of LegacyIterator types. This makes it possible to implement algorithms only in terms of iterators.
The template can be specialized for user-defined iterators so that the information about the iterator can be retrieved even if the type does not provide the usual typedefs.
User specializations may define the nested type |
(since C++20) |
Contents |
[edit] Template parameters
Iter | - | the iterator type to retrieve properties for |
[edit] Member types
Nested type | Definition |
difference_type
|
Iter::difference_type
|
value_type
|
Iter::value_type
|
pointer
|
Iter::pointer
|
reference
|
Iter::reference
|
iterator_category
|
Iter::iterator_category
|
If |
(since C++17) (until C++20) | |||||||||||||||||||||||
If
|