From Jason Turner

[utility.arg.requirements]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpsc55mjc6/{from.md → to.md} +20 -20
tmp/tmpsc55mjc6/{from.md → to.md} RENAMED
@@ -1,67 +1,67 @@
1
  #### Template argument requirements <a id="utility.arg.requirements">[[utility.arg.requirements]]</a>
2
 
3
  The template definitions in the C++ standard library refer to various
4
  named requirements whose details are set out in Tables 
5
- [[tab:equalitycomparable]]– [[tab:destructible]]. In these tables, `T`
6
- is an object or reference type to be supplied by a C++program
7
- instantiating a template; `a`, `b`, and `c` are values of type (possibly
8
- `const`) `T`; `s` and `t` are modifiable lvalues of type `T`; `u`
9
- denotes an identifier; `rv` is an rvalue of type `T`; and `v` is an
10
  lvalue of type (possibly `const`) `T` or an rvalue of type `const T`.
11
 
12
  In general, a default constructor is not required. Certain container
13
  class member function signatures specify `T()` as a default argument.
14
- `T()` shall be a well-defined expression ([[dcl.init]]) if one of those
15
- signatures is called using the default argument ([[dcl.fct.default]]).
16
 
17
- **Table: `EqualityComparable` requirements** <a id="equalitycomparable">[equalitycomparable]</a>
18
 
19
  | Expression | Return type |
20
  | ---------- | ----------- |
21
  | `a == b` | convertible to `bool` | `==` is an equivalence relation, that is, it has the following properties: For all `a`, `a == a`.; If `a == b`, then `b == a`.; If `a == b` and `b == c`, then `a == c`. |
22
 
23
- **Table: `LessThanComparable` requirements** <a id="lessthancomparable">[lessthancomparable]</a>
 
24
 
25
  | Expression | Return type | Requirement |
26
- | ---------- | --------------------- | --------------------------------------------------------- |
27
- | `a < b` | convertible to `bool` | `<` is a strict weak ordering relation~([[alg.sorting]]) |
28
 
29
- **Table: `DefaultConstructible` requirements** <a id="defaultconstructible">[defaultconstructible]</a>
 
30
 
31
  | Expression | Post-condition |
32
  | -------------- | ------------------------------------------------------------------- |
33
  | `T t;` | object `t` is default-initialized |
34
  | `T u{};` | object `u` is value-initialized or aggregate-initialized |
35
  | `T()`<br>`T{}` | an object of type `T` is value-initialized or aggregate-initialized |
36
 
 
37
  [*Note 1*: `rv` must still meet the requirements of the library
38
  component that is using it. The operations listed in those requirements
39
  must work as specified whether `rv` has been moved from or
40
  not. — *end note*]
41
 
42
- **Table: `CopyConstructible` requirements (in addition to `MoveConstructible`)** <a id="copyconstructible">[copyconstructible]</a>
43
 
44
  | Expression | Post-condition |
45
  | ---------- | --------------------------------------------------------- |
46
  | `T u = v;` | the value of `v` is unchanged and is equivalent to ` u` |
47
  | `T(v)` | the value of `v` is unchanged and is equivalent to `T(v)` |
48
 
 
49
  [*Note 2*:  `rv` must still meet the requirements of the library
50
  component that is using it, whether or not `t` and `rv` refer to the
51
  same object. The operations listed in those requirements must work as
52
  specified whether `rv` has been moved from or not. — *end note*]
53
 
54
- **Table: `CopyAssignable` requirements (in addition to `MoveAssignable`)** <a id="copyassignable">[copyassignable]</a>
55
 
56
  | Expression | Return type | Return value | Post-condition |
57
  | ---------- | ----------- | ------------ | ------------------------------------------------------- |
58
  | `t = v` | `T&` | `t` | `t` is equivalent to `v`, the value of `v` is unchanged |
59
 
60
 
61
- **Table: `Destructible` requirements** <a id="destructible">[destructible]</a>
62
-
63
- | Expression | Post-condition |
64
- | ---------- | --------------------------------------------------------------------- |
65
- | `u.~T()` | All resources owned by `u` are reclaimed, no exception is propagated. |
66
-
67
 
 
1
  #### Template argument requirements <a id="utility.arg.requirements">[[utility.arg.requirements]]</a>
2
 
3
  The template definitions in the C++ standard library refer to various
4
  named requirements whose details are set out in Tables 
5
+ [[tab:cpp17.equalitycomparable]]– [[tab:cpp17.destructible]]. In these
6
+ tables, `T` is an object or reference type to be supplied by a C++
7
+ program instantiating a template; `a`, `b`, and `c` are values of type
8
+ (possibly `const`) `T`; `s` and `t` are modifiable lvalues of type `T`;
9
+ `u` denotes an identifier; `rv` is an rvalue of type `T`; and `v` is an
10
  lvalue of type (possibly `const`) `T` or an rvalue of type `const T`.
11
 
12
  In general, a default constructor is not required. Certain container
13
  class member function signatures specify `T()` as a default argument.
14
+ `T()` shall be a well-defined expression [[dcl.init]] if one of those
15
+ signatures is called using the default argument [[dcl.fct.default]].
16
 
17
+ **Table: Cpp17EqualityComparable requirements** <a id="cpp17.equalitycomparable">[cpp17.equalitycomparable]</a>
18
 
19
  | Expression | Return type |
20
  | ---------- | ----------- |
21
  | `a == b` | convertible to `bool` | `==` is an equivalence relation, that is, it has the following properties: For all `a`, `a == a`.; If `a == b`, then `b == a`.; If `a == b` and `b == c`, then `a == c`. |
22
 
23
+
24
+ **Table: Cpp17LessThanComparable requirements** <a id="cpp17.lessthancomparable">[cpp17.lessthancomparable]</a>
25
 
26
  | Expression | Return type | Requirement |
27
+ | ---------- | --------------------- | ------------------------------------------------------ |
28
+ | `a < b` | convertible to `bool` | `<` is a strict weak ordering relation [[alg.sorting]] |
29
 
30
+
31
+ **Table: Cpp17DefaultConstructible requirements** <a id="cpp17.defaultconstructible">[cpp17.defaultconstructible]</a>
32
 
33
  | Expression | Post-condition |
34
  | -------------- | ------------------------------------------------------------------- |
35
  | `T t;` | object `t` is default-initialized |
36
  | `T u{};` | object `u` is value-initialized or aggregate-initialized |
37
  | `T()`<br>`T{}` | an object of type `T` is value-initialized or aggregate-initialized |
38
 
39
+
40
  [*Note 1*: `rv` must still meet the requirements of the library
41
  component that is using it. The operations listed in those requirements
42
  must work as specified whether `rv` has been moved from or
43
  not. — *end note*]
44
 
45
+ **Table: Cpp17CopyConstructible requirements (in addition to Cpp17MoveConstructible)** <a id="cpp17.copyconstructible">[cpp17.copyconstructible]</a>
46
 
47
  | Expression | Post-condition |
48
  | ---------- | --------------------------------------------------------- |
49
  | `T u = v;` | the value of `v` is unchanged and is equivalent to ` u` |
50
  | `T(v)` | the value of `v` is unchanged and is equivalent to `T(v)` |
51
 
52
+
53
  [*Note 2*:  `rv` must still meet the requirements of the library
54
  component that is using it, whether or not `t` and `rv` refer to the
55
  same object. The operations listed in those requirements must work as
56
  specified whether `rv` has been moved from or not. — *end note*]
57
 
58
+ **Table: Cpp17CopyAssignable requirements (in addition to Cpp17MoveAssignable)** <a id="cpp17.copyassignable">[cpp17.copyassignable]</a>
59
 
60
  | Expression | Return type | Return value | Post-condition |
61
  | ---------- | ----------- | ------------ | ------------------------------------------------------- |
62
  | `t = v` | `T&` | `t` | `t` is equivalent to `v`, the value of `v` is unchanged |
63
 
64
 
65
+ [*Note 3*: Array types and non-object types are not
66
+ *Cpp17Destructible*. — *end note*]
 
 
 
 
67