From Jason Turner

[meta.unary.prop.query]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpen656f6e/{from.md → to.md} +21 -13
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 sub-clause 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 `BaseCharacteristic` of `integral_constant<size_t, Value>`.
 
 
8
 
9
  ``` cpp
10
  // the following assertions hold:
11
- assert(rank<int>::value == 0);
12
- assert(rank<int[2]>::value == 1);
13
- assert(rank<int[][4]>::value == 2);
14
  ```
15
 
 
 
 
 
16
  ``` cpp
17
  // the following assertions hold:
18
- assert(extent<int>::value == 0);
19
- assert(extent<int[2]>::value == 2);
20
- assert(extent<int[2][4]>::value == 2);
21
- assert(extent<int[][4]>::value == 0);
22
- assert((extent<int, 1>::value) == 0);
23
- assert((extent<int[2], 1>::value) == 0);
24
- assert((extent<int[2][4], 1>::value) == 4);
25
- assert((extent<int[][4], 1>::value) == 4);
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
+