std::indirectly_readable_traits

From cppreference.com
< cpp‎ | iterator
 
 
Iterator library
Iterator concepts
Iterator primitives
indirectly_readable_traits
(C++20)

Algorithm concepts and utilities
Indirect callable concepts
Common algorithm requirements
Utilities
Iterator adaptors
Stream iterators
Iterator customization points
Iterator operations
(C++11)
(C++11)
Range access
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
Defined in header <iterator>
template< class I >
struct indirectly_readable_traits { };
(1) (since C++20)
template< class T >
struct indirectly_readable_traits<T*>;
(2) (since C++20)
template< class I >

  requires std::is_array_v<I>

struct indirectly_readable_traits<I>;
(3) (since C++20)
template< class T >
struct indirectly_readable_traits<const T> : indirectly_readable_traits<T> { };
(4) (since C++20)
template <class T>

  requires requires { typename T::value_type; }

struct indirectly_readable_traits<T>;
(5) (since C++20)
template <class T>

  requires requires { typename T::element_type; }

struct indirectly_readable_traits<T>;
(6) (since C++20)

Computes the associated value type of the type I, if any. Users may specialize indirectly_readable_traits for a program-defined type.

1) Primary template is an empty struct.
2) Specialization for pointers. If 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.
3) Specialization for array types. Provides a member type value_type equal to std::remove_cv_t<std::remove_extent_t<I>>.
4) Specialization for const-qualified types.
5) Specialization for types that define a public and accessible member type 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.
6) Specialization for types that define a public and accessible member 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.

Notes

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 indirectly_readable types such as iterators. It is not intended for use with ranges.

Example

See also

specifies that a type is indirectly 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)