Files
cppdraft_translate/cppdraft/depr/tuple.md
2025-10-25 03:02:53 +03:00

3.7 KiB
Raw Blame History

[depr.tuple]

Annex D (normative) Compatibility features [depr]

D.15 Tuple [depr.tuple]

1

#

The header has the following additions:namespace std {template struct tuple_size; template struct tuple_size; template<size_t I, class T> struct tuple_element<I, volatile T>; template<size_t I, class T> struct tuple_element<I, const volatile T>;}

🔗

template<class T> struct tuple_size<volatile T>; template<class T> struct tuple_size<const volatile T>;

2

#

Let TS denote tuple_size of the cv-unqualified type T.

If the expression TS::value is well-formed when treated as an unevaluated operand, then specializations of each of the two templates meet the Cpp17TransformationTrait requirements with a base characteristic ofintegral_constant<size_t, TS::value>.

Otherwise, they have no member value.

3

#

Access checking is performed as if in a context unrelated to TS and T.

Only the validity of the immediate context of the expression is considered.

4

#

In addition to being available via inclusion of the header, the two templates are available when any of the headers,, or are included.

🔗

template<size_t I, class T> struct tuple_element<I, volatile T>; template<size_t I, class T> struct tuple_element<I, const volatile T>;

5

#

Let TE denote tuple_element_t<I, T> of the cv-unqualified type T.

Then specializations of each of the two templates meet the Cpp17TransformationTrait requirements with a member typedef type that names the following type:

for the first specialization, add_volatile_t, and

for the second specialization, add_cv_t.

6

#

In addition to being available via inclusion of the header, the two templates are available when any of the headers,, or are included.