tmp/tmpnl30q67s/{from.md → to.md}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
### Class `error_condition` <a id="syserr.errcondition">[[syserr.errcondition]]</a>
|
| 2 |
|
| 3 |
-
####
|
| 4 |
|
| 5 |
The class `error_condition` describes an object used to hold values
|
| 6 |
identifying error conditions.
|
| 7 |
|
| 8 |
[*Note 1*: `error_condition` values are portable abstractions, while
|
| 9 |
-
`error_code` values
|
| 10 |
specific. — *end note*]
|
| 11 |
|
| 12 |
``` cpp
|
| 13 |
namespace std {
|
| 14 |
class error_condition {
|
|
@@ -36,71 +36,61 @@ namespace std {
|
|
| 36 |
const error_category* cat_; // exposition only
|
| 37 |
};
|
| 38 |
}
|
| 39 |
```
|
| 40 |
|
| 41 |
-
####
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
error_condition() noexcept;
|
| 45 |
```
|
| 46 |
|
| 47 |
-
*
|
| 48 |
-
|
| 49 |
-
*Postconditions:* `val_ == 0` and `cat_ == &generic_category()`.
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
error_condition(int val, const error_category& cat) noexcept;
|
| 53 |
```
|
| 54 |
|
| 55 |
-
*
|
| 56 |
-
|
| 57 |
-
*Postconditions:* `val_ == val` and `cat_ == &cat`.
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
template<class ErrorConditionEnum>
|
| 61 |
error_condition(ErrorConditionEnum e) noexcept;
|
| 62 |
```
|
| 63 |
|
| 64 |
-
*
|
|
|
|
| 65 |
|
| 66 |
-
*
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
This constructor shall not participate in overload resolution unless
|
| 71 |
-
`is_error_condition_enum_v<ErrorConditionEnum>` is `true`.
|
| 72 |
-
|
| 73 |
-
#### Class `error_condition` modifiers <a id="syserr.errcondition.modifiers">[[syserr.errcondition.modifiers]]</a>
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
void assign(int val, const error_category& cat) noexcept;
|
| 77 |
```
|
| 78 |
|
| 79 |
-
*
|
| 80 |
|
| 81 |
``` cpp
|
| 82 |
template<class ErrorConditionEnum>
|
| 83 |
error_condition& operator=(ErrorConditionEnum e) noexcept;
|
| 84 |
```
|
| 85 |
|
| 86 |
-
*
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
*Returns:* `*this`.
|
| 89 |
|
| 90 |
-
*Remarks:*
|
| 91 |
-
|
| 92 |
-
This operator shall not participate in overload resolution unless
|
| 93 |
-
`is_error_condition_enum_v<ErrorConditionEnum>` is `true`.
|
| 94 |
-
|
| 95 |
``` cpp
|
| 96 |
void clear() noexcept;
|
| 97 |
```
|
| 98 |
|
| 99 |
-
*
|
| 100 |
|
| 101 |
-
####
|
| 102 |
|
| 103 |
``` cpp
|
| 104 |
int value() const noexcept;
|
| 105 |
```
|
| 106 |
|
|
@@ -122,11 +112,11 @@ string message() const;
|
|
| 122 |
explicit operator bool() const noexcept;
|
| 123 |
```
|
| 124 |
|
| 125 |
*Returns:* `value() != 0`.
|
| 126 |
|
| 127 |
-
####
|
| 128 |
|
| 129 |
``` cpp
|
| 130 |
error_condition make_error_condition(errc e) noexcept;
|
| 131 |
```
|
| 132 |
|
|
|
|
| 1 |
### Class `error_condition` <a id="syserr.errcondition">[[syserr.errcondition]]</a>
|
| 2 |
|
| 3 |
+
#### Overview <a id="syserr.errcondition.overview">[[syserr.errcondition.overview]]</a>
|
| 4 |
|
| 5 |
The class `error_condition` describes an object used to hold values
|
| 6 |
identifying error conditions.
|
| 7 |
|
| 8 |
[*Note 1*: `error_condition` values are portable abstractions, while
|
| 9 |
+
`error_code` values [[syserr.errcode]] are implementation
|
| 10 |
specific. — *end note*]
|
| 11 |
|
| 12 |
``` cpp
|
| 13 |
namespace std {
|
| 14 |
class error_condition {
|
|
|
|
| 36 |
const error_category* cat_; // exposition only
|
| 37 |
};
|
| 38 |
}
|
| 39 |
```
|
| 40 |
|
| 41 |
+
#### Constructors <a id="syserr.errcondition.constructors">[[syserr.errcondition.constructors]]</a>
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
error_condition() noexcept;
|
| 45 |
```
|
| 46 |
|
| 47 |
+
*Ensures:* `val_ == 0` and `cat_ == &generic_category()`.
|
|
|
|
|
|
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
error_condition(int val, const error_category& cat) noexcept;
|
| 51 |
```
|
| 52 |
|
| 53 |
+
*Ensures:* `val_ == val` and `cat_ == &cat`.
|
|
|
|
|
|
|
| 54 |
|
| 55 |
``` cpp
|
| 56 |
template<class ErrorConditionEnum>
|
| 57 |
error_condition(ErrorConditionEnum e) noexcept;
|
| 58 |
```
|
| 59 |
|
| 60 |
+
*Constraints:* `is_error_condition_enum_v<ErrorConditionEnum>` is
|
| 61 |
+
`true`.
|
| 62 |
|
| 63 |
+
*Ensures:* `*this == make_error_condition(e)`.
|
| 64 |
|
| 65 |
+
#### Modifiers <a id="syserr.errcondition.modifiers">[[syserr.errcondition.modifiers]]</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
``` cpp
|
| 68 |
void assign(int val, const error_category& cat) noexcept;
|
| 69 |
```
|
| 70 |
|
| 71 |
+
*Ensures:* `val_ == val` and `cat_ == &cat`.
|
| 72 |
|
| 73 |
``` cpp
|
| 74 |
template<class ErrorConditionEnum>
|
| 75 |
error_condition& operator=(ErrorConditionEnum e) noexcept;
|
| 76 |
```
|
| 77 |
|
| 78 |
+
*Constraints:* `is_error_condition_enum_v<ErrorConditionEnum>` is
|
| 79 |
+
`true`.
|
| 80 |
+
|
| 81 |
+
*Ensures:* `*this == make_error_condition(e)`.
|
| 82 |
|
| 83 |
*Returns:* `*this`.
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
``` cpp
|
| 86 |
void clear() noexcept;
|
| 87 |
```
|
| 88 |
|
| 89 |
+
*Ensures:* `value() == 0` and `category() == generic_category()`.
|
| 90 |
|
| 91 |
+
#### Observers <a id="syserr.errcondition.observers">[[syserr.errcondition.observers]]</a>
|
| 92 |
|
| 93 |
``` cpp
|
| 94 |
int value() const noexcept;
|
| 95 |
```
|
| 96 |
|
|
|
|
| 112 |
explicit operator bool() const noexcept;
|
| 113 |
```
|
| 114 |
|
| 115 |
*Returns:* `value() != 0`.
|
| 116 |
|
| 117 |
+
#### Non-member functions <a id="syserr.errcondition.nonmembers">[[syserr.errcondition.nonmembers]]</a>
|
| 118 |
|
| 119 |
``` cpp
|
| 120 |
error_condition make_error_condition(errc e) noexcept;
|
| 121 |
```
|
| 122 |
|