Defined in header <iterator> | ||
---|---|---|
template< class I > struct readable_traits { }; | (1) | (since C++20) |
template< class T > struct readable_traits<T*>; | (2) | (since C++20) |
template< class I > requires std::is_array_v<I> struct readable_traits<I>; | (3) | (since C++20) |
template< class T > struct readable_traits<const T> : value_type<T> { }; | (4) | (since C++20) |
template <class T> requires requires { typename T::value_type; } struct readable_traits<T>; | (5) | (since C++20) |
template <class T> requires requires { typename T::element_type; } struct readable_traits<T>; | (6) | (since C++20) |
Computes the associated value type of the type I
, if any. Users may specialize readable_traits
for a program-defined type.
T
is an object type, provides a member type value_type
equal to std::remove_cv_t<T>
. Otherwise, there is no member value_type
.value_type
equal to std::remove_cv_t<std::remove_extent_t<I>>
.value_type
. If T::value_type
is an object type, provides a member type value_type
equal to std::remove_cv_t<typename T::value_type>
. Otherwise, there is no member value_type
.element_type
(e.g., std::shared_ptr
). If T::element_type
is an object type, provides a member type value_type
equal to std::remove_cv_t<typename T::element_type>
. Otherwise, there is no member value_type
.If a type contains both a value_type
member and a element_type
member, then the specializations (5) and (6) are ambiguous.
value_type
is intended for use with Readable
types such as iterators. It is not intended for use with ranges.
specifies that a type is readable by applying operator * (concept) |
|
computes the associate types of an iterator (alias template) |
|
provides uniform interface to the properties of an iterator (class template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/iterator/readable_traits