From Jason Turner

[variant.helper]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4d16onw1/{from.md → to.md} +10 -18
tmp/tmp4d16onw1/{from.md → to.md} RENAMED
@@ -2,48 +2,40 @@
2
 
3
  ``` cpp
4
  template<class T> struct variant_size;
5
  ```
6
 
7
- *Remarks:* All specializations of `variant_size` shall meet the
8
- `UnaryTypeTrait` requirements ([[meta.rqmts]]) with a base
9
- characteristic of `integral_constant<size_t, N>` for some `N`.
10
 
11
  ``` cpp
12
  template<class T> class variant_size<const T>;
13
- template <class T> class variant_size<volatile T>;
14
- template <class T> class variant_size<const volatile T>;
15
  ```
16
 
17
  Let `VS` denote `variant_size<T>` of the cv-unqualified type `T`. Then
18
- each of the three templates shall meet the `UnaryTypeTrait`
19
- requirements ([[meta.rqmts]]) with a base characteristic of
20
  `integral_constant<size_t, VS::value>`.
21
 
22
  ``` cpp
23
  template<class... Types>
24
  struct variant_size<variant<Types...>> : integral_constant<size_t, sizeof...(Types)> { };
25
  ```
26
 
27
  ``` cpp
28
  template<size_t I, class T> class variant_alternative<I, const T>;
29
- template <size_t I, class T> class variant_alternative<I, volatile T>;
30
- template <size_t I, class T> class variant_alternative<I, const volatile T>;
31
  ```
32
 
33
  Let `VA` denote `variant_alternative<I, T>` of the cv-unqualified type
34
- `T`. Then each of the three templates shall meet the
35
- `TransformationTrait` requirements ([[meta.rqmts]]) with a member
36
- typedef `type` that names the following type:
37
-
38
- - for the first specialization, `add_const_t<VA::type>`,
39
- - for the second specialization, `add_volatile_t<VA::type>`, and
40
- - for the third specialization, `add_cv_t<VA::type>`.
41
 
42
  ``` cpp
43
  variant_alternative<I, variant<Types...>>::type
44
  ```
45
 
46
- *Requires:* `I < sizeof...(Types)`.
47
 
48
- *Value:* The type `T_I`.
49
 
 
2
 
3
  ``` cpp
4
  template<class T> struct variant_size;
5
  ```
6
 
7
+ All specializations of `variant_size` meet the *Cpp17UnaryTypeTrait*
8
+ requirements [[meta.rqmts]] with a base characteristic of
9
+ `integral_constant<size_t, N>` for some `N`.
10
 
11
  ``` cpp
12
  template<class T> class variant_size<const T>;
 
 
13
  ```
14
 
15
  Let `VS` denote `variant_size<T>` of the cv-unqualified type `T`. Then
16
+ each specialization of the template meets the *Cpp17UnaryTypeTrait*
17
+ requirements [[meta.rqmts]] with a base characteristic of
18
  `integral_constant<size_t, VS::value>`.
19
 
20
  ``` cpp
21
  template<class... Types>
22
  struct variant_size<variant<Types...>> : integral_constant<size_t, sizeof...(Types)> { };
23
  ```
24
 
25
  ``` cpp
26
  template<size_t I, class T> class variant_alternative<I, const T>;
 
 
27
  ```
28
 
29
  Let `VA` denote `variant_alternative<I, T>` of the cv-unqualified type
30
+ `T`. Then each specialization of the template meets the
31
+ *Cpp17TransformationTrait* requirements [[meta.rqmts]] with a member
32
+ typedef `type` that names the type `add_const_t<VA::type>`.
 
 
 
 
33
 
34
  ``` cpp
35
  variant_alternative<I, variant<Types...>>::type
36
  ```
37
 
38
+ *Mandates:* `I` < `sizeof...(Types)`.
39
 
40
+ *Type:* The type `T_I`.
41