tmp/tmppsol7rom/{from.md → to.md}
RENAMED
|
@@ -1,35 +1,35 @@
|
|
| 1 |
### Type property queries <a id="meta.unary.prop.query">[[meta.unary.prop.query]]</a>
|
| 2 |
|
| 3 |
-
|
| 4 |
-
of types at compile time.
|
| 5 |
|
| 6 |
Each of these templates shall be a *Cpp17UnaryTypeTrait* [[meta.rqmts]]
|
| 7 |
with a base characteristic of `integral_constant<size_t, Value>`.
|
| 8 |
|
| 9 |
[*Example 1*:
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
// the following assertions hold:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
```
|
| 17 |
|
| 18 |
— *end example*]
|
| 19 |
|
| 20 |
[*Example 2*:
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
// the following assertions hold:
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
```
|
| 33 |
|
| 34 |
— *end example*]
|
| 35 |
|
|
|
|
| 1 |
### Type property queries <a id="meta.unary.prop.query">[[meta.unary.prop.query]]</a>
|
| 2 |
|
| 3 |
+
The templates specified in [[meta.unary.prop.query]] may be used to
|
| 4 |
+
query properties of types at compile time.
|
| 5 |
|
| 6 |
Each of these templates shall be a *Cpp17UnaryTypeTrait* [[meta.rqmts]]
|
| 7 |
with a base characteristic of `integral_constant<size_t, Value>`.
|
| 8 |
|
| 9 |
[*Example 1*:
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
// the following assertions hold:
|
| 13 |
+
static_assert(rank_v<int> == 0);
|
| 14 |
+
static_assert(rank_v<int[2]> == 1);
|
| 15 |
+
static_assert(rank_v<int[][4]> == 2);
|
| 16 |
```
|
| 17 |
|
| 18 |
— *end example*]
|
| 19 |
|
| 20 |
[*Example 2*:
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
// the following assertions hold:
|
| 24 |
+
static_assert(extent_v<int> == 0);
|
| 25 |
+
static_assert(extent_v<int[2]> == 2);
|
| 26 |
+
static_assert(extent_v<int[2][4]> == 2);
|
| 27 |
+
static_assert(extent_v<int[][4]> == 0);
|
| 28 |
+
static_assert(extent_v<int, 1> == 0);
|
| 29 |
+
static_assert(extent_v<int[2], 1> == 0);
|
| 30 |
+
static_assert(extent_v<int[2][4], 1> == 4);
|
| 31 |
+
static_assert(extent_v<int[][4], 1> == 4);
|
| 32 |
```
|
| 33 |
|
| 34 |
— *end example*]
|
| 35 |
|