2.0 KiB
[depr.variant]
Annex D (normative) Compatibility features [depr]
D.16 Variant [depr.variant]
The header has the following additions:namespace std {template struct variant_size; template struct variant_size; template<size_t I, class T> struct variant_alternative<I, volatile T>; template<size_t I, class T> struct variant_alternative<I, const volatile T>;}
template<class T> struct variant_size<volatile T>; template<class T> struct variant_size<const volatile T>;
Let VS denote variant_size of the cv-unqualified type T.
Then specializations of each of the two templates meet the Cpp17UnaryTypeTrait requirements with a base characteristic of integral_constant<size_t, VS::value>.
template<size_t I, class T> struct variant_alternative<I, volatile T>; template<size_t I, class T> struct variant_alternative<I, const volatile T>;
Let VA denote variant_alternative<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<VA::type>, and
for the second specialization, add_cv_t<VA::type>.