template< class I >
struct indirectly_readable_traits {};
struct indirectly_readable_traits<T*> :
struct indirectly_readable_traits<const T> :
struct indirectly_readable_traits<T> :
struct indirectly_readable_traits<T> :
requires /* has-member-element-type */<T>
requires /* has-member-element-type */<T> &&
std::same_as<std::remove_cv_t<typename T::element_type>,
std::remove_cv_t<typename T::value_type>>
struct indirectly_readable_traits<T> :
Helper classes and concepts
template< class >
struct /* cond-value-type */ {};
concept /* has-member-value-type */ =
concept /* has-member-element-type */ =
Computes the associated value type of the template argument. If the associated value type exists, it is represented by the nested type value_type
, otherwise value_type
is not defined. A program may specialize indirectly_readable_traits
for a program-defined type.
The specializations above can be informally described as below.
Given a type T
, its associated value type V
is determined as follows:
T
is const-qualified, V
is the associated value type of const-unqualified T
.T
is an array type, V
is the cv-unqualified array element type.C
is determined first:T
is a pointer type, C
is the pointed-to type.T
has nested types value_type
and element_type
:C
is typename T::value_type
.C
is undefined.T
has the nested type value_type
but not element_type
, C
is typename T::value_type
.T
has the nested type element_type
but not value_type
, C
is typename T::element_type
.C
is undefined.V
is determined from C
as follows:
C
is undefined, or C
is not an object type, V
is undefined.V
is cv-unqualified C
.value_type
is intended for use with indirectly_readable
types such as iterators. It is not intended for use with ranges.
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 3446 C++20 specializations (5,6) were ambiguous for types havingvalue_type
and element_type
nested types added specialization (8) LWG 3541 C++20 LWG 3446 introduced hard error for ambiguous cases
value_type
and element_type
are different added specialization (7) [edit] See also
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4