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