tmp/tmp4d16onw1/{from.md → to.md}
RENAMED
|
@@ -2,48 +2,40 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class T> struct variant_size;
|
| 5 |
```
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 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
|
| 19 |
-
requirements
|
| 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
|
| 35 |
-
|
| 36 |
-
typedef `type` that names the
|
| 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 |
-
*
|
| 47 |
|
| 48 |
-
*
|
| 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 |
|