Annex D (normative) Compatibility features [depr] (original) (raw)

D.16 Variant [depr.variant]

The header has the following additions:namespace std { template<class T> struct variant_size<volatile T>;template<class T> struct variant_size<const volatile T>;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<T>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: