From Jason Turner

[syserr.errcode]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpq1pa9i3w/{from.md → to.md} +18 -21
tmp/tmpq1pa9i3w/{from.md → to.md} RENAMED
@@ -2,30 +2,32 @@
2
 
3
  #### Class `error_code` overview <a id="syserr.errcode.overview">[[syserr.errcode.overview]]</a>
4
 
5
  The class `error_code` describes an object used to hold error code
6
  values, such as those originating from the operating system or other
7
- low-level application program interfaces. Class `error_code` is an
8
- adjunct to error reporting by exception.
 
 
9
 
10
  ``` cpp
11
  namespace std {
12
  class error_code {
13
  public:
14
- // [syserr.errcode.constructors] constructors:
15
  error_code() noexcept;
16
  error_code(int val, const error_category& cat) noexcept;
17
  template <class ErrorCodeEnum>
18
  error_code(ErrorCodeEnum e) noexcept;
19
 
20
- // [syserr.errcode.modifiers] modifiers:
21
  void assign(int val, const error_category& cat) noexcept;
22
  template <class ErrorCodeEnum>
23
  error_code& operator=(ErrorCodeEnum e) noexcept;
24
  void clear() noexcept;
25
 
26
- // [syserr.errcode.observers] observers:
27
  int value() const noexcept;
28
  const error_category& category() const noexcept;
29
  error_condition default_error_condition() const noexcept;
30
  string message() const;
31
  explicit operator bool() const noexcept;
@@ -33,18 +35,17 @@ namespace std {
33
  private:
34
  int val_; // exposition only
35
  const error_category* cat_; // exposition only
36
  };
37
 
38
- // [syserr.errcode.nonmembers] non-member functions:
39
  error_code make_error_code(errc e) noexcept;
40
- bool operator<(const error_code& lhs, const error_code& rhs) noexcept;
41
 
42
  template <class charT, class traits>
43
  basic_ostream<charT, traits>&
44
  operator<<(basic_ostream<charT, traits>& os, const error_code& ec);
45
- } // namespace std
46
  ```
47
 
48
  #### Class `error_code` constructors <a id="syserr.errcode.constructors">[[syserr.errcode.constructors]]</a>
49
 
50
  ``` cpp
@@ -70,12 +71,14 @@ template <class ErrorCodeEnum>
70
 
71
  *Effects:* Constructs an object of type `error_code`.
72
 
73
  *Postconditions:* `*this == make_error_code(e)`.
74
 
75
- *Remarks:* This constructor shall not participate in overload resolution
76
- unless `is_error_code_enum<ErrorCodeEnum>::value` is `true`.
 
 
77
 
78
  #### Class `error_code` modifiers <a id="syserr.errcode.modifiers">[[syserr.errcode.modifiers]]</a>
79
 
80
  ``` cpp
81
  void assign(int val, const error_category& cat) noexcept;
@@ -90,12 +93,14 @@ template <class ErrorCodeEnum>
90
 
91
  *Postconditions:* `*this == make_error_code(e)`.
92
 
93
  *Returns:* `*this`.
94
 
95
- *Remarks:* This operator shall not participate in overload resolution
96
- unless `is_error_code_enum<ErrorCodeEnum>::value` is `true`.
 
 
97
 
98
  ``` cpp
99
  void clear() noexcept;
100
  ```
101
 
@@ -139,21 +144,13 @@ explicit operator bool() const noexcept;
139
  error_code make_error_code(errc e) noexcept;
140
  ```
141
 
142
  *Returns:* `error_code(static_cast<int>(e), generic_category())`.
143
 
144
- ``` cpp
145
- bool operator<(const error_code& lhs, const error_code& rhs) noexcept;
146
- ```
147
-
148
- *Returns:*
149
- `lhs.category() < rhs.category() || lhs.category() == rhs.category() && lhs.value() < rhs.value()`.
150
-
151
  ``` cpp
152
  template <class charT, class traits>
153
  basic_ostream<charT, traits>&
154
  operator<<(basic_ostream<charT, traits>& os, const error_code& ec);
155
  ```
156
 
157
- *Effects:*
158
- `os <``<`` ec.category().name() <``<`` ’:’ <``<`` ec.value()`.
159
 
 
2
 
3
  #### Class `error_code` overview <a id="syserr.errcode.overview">[[syserr.errcode.overview]]</a>
4
 
5
  The class `error_code` describes an object used to hold error code
6
  values, such as those originating from the operating system or other
7
+ low-level application program interfaces.
8
+
9
+ [*Note 1*: Class `error_code` is an adjunct to error reporting by
10
+ exception. — *end note*]
11
 
12
  ``` cpp
13
  namespace std {
14
  class error_code {
15
  public:
16
+ // [syserr.errcode.constructors], constructors
17
  error_code() noexcept;
18
  error_code(int val, const error_category& cat) noexcept;
19
  template <class ErrorCodeEnum>
20
  error_code(ErrorCodeEnum e) noexcept;
21
 
22
+ // [syserr.errcode.modifiers], modifiers
23
  void assign(int val, const error_category& cat) noexcept;
24
  template <class ErrorCodeEnum>
25
  error_code& operator=(ErrorCodeEnum e) noexcept;
26
  void clear() noexcept;
27
 
28
+ // [syserr.errcode.observers], observers
29
  int value() const noexcept;
30
  const error_category& category() const noexcept;
31
  error_condition default_error_condition() const noexcept;
32
  string message() const;
33
  explicit operator bool() const noexcept;
 
35
  private:
36
  int val_; // exposition only
37
  const error_category* cat_; // exposition only
38
  };
39
 
40
+ // [syserr.errcode.nonmembers], non-member functions
41
  error_code make_error_code(errc e) noexcept;
 
42
 
43
  template <class charT, class traits>
44
  basic_ostream<charT, traits>&
45
  operator<<(basic_ostream<charT, traits>& os, const error_code& ec);
46
+ }
47
  ```
48
 
49
  #### Class `error_code` constructors <a id="syserr.errcode.constructors">[[syserr.errcode.constructors]]</a>
50
 
51
  ``` cpp
 
71
 
72
  *Effects:* Constructs an object of type `error_code`.
73
 
74
  *Postconditions:* `*this == make_error_code(e)`.
75
 
76
+ *Remarks:*
77
+
78
+ This constructor shall not participate in overload resolution unless
79
+ `is_error_code_enum_v<ErrorCodeEnum>` is `true`.
80
 
81
  #### Class `error_code` modifiers <a id="syserr.errcode.modifiers">[[syserr.errcode.modifiers]]</a>
82
 
83
  ``` cpp
84
  void assign(int val, const error_category& cat) noexcept;
 
93
 
94
  *Postconditions:* `*this == make_error_code(e)`.
95
 
96
  *Returns:* `*this`.
97
 
98
+ *Remarks:*
99
+
100
+ This operator shall not participate in overload resolution unless
101
+ `is_error_code_enum_v<ErrorCodeEnum>` is `true`.
102
 
103
  ``` cpp
104
  void clear() noexcept;
105
  ```
106
 
 
144
  error_code make_error_code(errc e) noexcept;
145
  ```
146
 
147
  *Returns:* `error_code(static_cast<int>(e), generic_category())`.
148
 
 
 
 
 
 
 
 
149
  ``` cpp
150
  template <class charT, class traits>
151
  basic_ostream<charT, traits>&
152
  operator<<(basic_ostream<charT, traits>& os, const error_code& ec);
153
  ```
154
 
155
+ *Effects:* As if by: `os << ec.category().name() << ’:’ << ec.value();`
 
156