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
|
| 6 |
-
is an object or reference type to be supplied by a C++
|
| 7 |
-
instantiating a template; `a`, `b`, and `c` are values of type
|
| 8 |
-
`const`) `T`; `s` and `t` are modifiable lvalues of type `T`;
|
| 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
|
| 15 |
-
signatures is called using the default argument
|
| 16 |
|
| 17 |
-
**Table:
|
| 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 |
|
| 25 |
| Expression | Return type | Requirement |
|
| 26 |
-
| ---------- | --------------------- | ------------------------------------------------------
|
| 27 |
-
| `a < b` | convertible to `bool` | `<` is a strict weak ordering relation
|
| 28 |
|
| 29 |
-
|
|
|
|
| 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:
|
| 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:
|
| 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 |
-
**
|
| 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 |
|