From Jason Turner

[syserr.errcat]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjlao5yva/{from.md → to.md} +11 -30
tmp/tmpjlao5yva/{from.md → to.md} RENAMED
@@ -1,14 +1,14 @@
1
  ### Class `error_category` <a id="syserr.errcat">[[syserr.errcat]]</a>
2
 
3
- #### Class `error_category` overview <a id="syserr.errcat.overview">[[syserr.errcat.overview]]</a>
4
 
5
  The class `error_category` serves as a base class for types used to
6
  identify the source and encoding of a particular category of error code.
7
  Classes may be derived from `error_category` to support categories of
8
- errors in addition to those defined in this International Standard. Such
9
- classes shall behave as specified in this subclause.
10
 
11
  [*Note 1*: `error_category` objects are passed by reference, and two
12
  such objects are equal if they have the same address. This means that
13
  applications using custom `error_category` types should create a single
14
  object of each such type. — *end note*]
@@ -26,26 +26,19 @@ namespace std {
26
  virtual bool equivalent(int code, const error_condition& condition) const noexcept;
27
  virtual bool equivalent(const error_code& code, int condition) const noexcept;
28
  virtual string message(int ev) const = 0;
29
 
30
  bool operator==(const error_category& rhs) const noexcept;
31
- bool operator!=(const error_category& rhs) const noexcept;
32
- bool operator<(const error_category& rhs) const noexcept;
33
  };
34
 
35
  const error_category& generic_category() noexcept;
36
  const error_category& system_category() noexcept;
37
  }
38
  ```
39
 
40
- #### Class `error_category` virtual members <a id="syserr.errcat.virtuals">[[syserr.errcat.virtuals]]</a>
41
-
42
- ``` cpp
43
- virtual ~error_category();
44
- ```
45
-
46
- *Effects:* Destroys an object of class `error_category`.
47
 
48
  ``` cpp
49
  virtual const char* name() const noexcept = 0;
50
  ```
51
 
@@ -73,40 +66,28 @@ virtual bool equivalent(const error_code& code, int condition) const noexcept;
73
  virtual string message(int ev) const = 0;
74
  ```
75
 
76
  *Returns:* A string that describes the error condition denoted by `ev`.
77
 
78
- #### Class `error_category` non-virtual members <a id="syserr.errcat.nonvirtuals">[[syserr.errcat.nonvirtuals]]</a>
79
-
80
- ``` cpp
81
- constexpr error_category() noexcept;
82
- ```
83
-
84
- *Effects:* Constructs an object of class `error_category`.
85
 
86
  ``` cpp
87
  bool operator==(const error_category& rhs) const noexcept;
88
  ```
89
 
90
  *Returns:* `this == &rhs`.
91
 
92
  ``` cpp
93
- bool operator!=(const error_category& rhs) const noexcept;
94
  ```
95
 
96
- *Returns:* `!(*this == rhs)`.
97
 
98
- ``` cpp
99
- bool operator<(const error_category& rhs) const noexcept;
100
- ```
101
-
102
- *Returns:* `less<const error_category*>()(this, &rhs)`.
103
-
104
- [*Note 1*: `less` ([[comparisons]]) provides a total ordering for
105
- pointers. — *end note*]
106
 
107
- #### Program defined classes derived from `error_category` <a id="syserr.errcat.derived">[[syserr.errcat.derived]]</a>
108
 
109
  ``` cpp
110
  virtual const char* name() const noexcept = 0;
111
  ```
112
 
 
1
  ### Class `error_category` <a id="syserr.errcat">[[syserr.errcat]]</a>
2
 
3
+ #### Overview <a id="syserr.errcat.overview">[[syserr.errcat.overview]]</a>
4
 
5
  The class `error_category` serves as a base class for types used to
6
  identify the source and encoding of a particular category of error code.
7
  Classes may be derived from `error_category` to support categories of
8
+ errors in addition to those defined in this document. Such classes shall
9
+ behave as specified in subclause  [[syserr.errcat]].
10
 
11
  [*Note 1*: `error_category` objects are passed by reference, and two
12
  such objects are equal if they have the same address. This means that
13
  applications using custom `error_category` types should create a single
14
  object of each such type. — *end note*]
 
26
  virtual bool equivalent(int code, const error_condition& condition) const noexcept;
27
  virtual bool equivalent(const error_code& code, int condition) const noexcept;
28
  virtual string message(int ev) const = 0;
29
 
30
  bool operator==(const error_category& rhs) const noexcept;
31
+ strong_ordering operator<=>(const error_category& rhs) const noexcept;
 
32
  };
33
 
34
  const error_category& generic_category() noexcept;
35
  const error_category& system_category() noexcept;
36
  }
37
  ```
38
 
39
+ #### Virtual members <a id="syserr.errcat.virtuals">[[syserr.errcat.virtuals]]</a>
 
 
 
 
 
 
40
 
41
  ``` cpp
42
  virtual const char* name() const noexcept = 0;
43
  ```
44
 
 
66
  virtual string message(int ev) const = 0;
67
  ```
68
 
69
  *Returns:* A string that describes the error condition denoted by `ev`.
70
 
71
+ #### Non-virtual members <a id="syserr.errcat.nonvirtuals">[[syserr.errcat.nonvirtuals]]</a>
 
 
 
 
 
 
72
 
73
  ``` cpp
74
  bool operator==(const error_category& rhs) const noexcept;
75
  ```
76
 
77
  *Returns:* `this == &rhs`.
78
 
79
  ``` cpp
80
+ strong_ordering operator<=>(const error_category& rhs) const noexcept;
81
  ```
82
 
83
+ *Returns:* `compare_three_way()(this, &rhs)`.
84
 
85
+ [*Note 1*: `compare_three_way` [[comparisons.three.way]] provides a
86
+ total ordering for pointers. *end note*]
 
 
 
 
 
 
87
 
88
+ #### Program-defined classes derived from `error_category` <a id="syserr.errcat.derived">[[syserr.errcat.derived]]</a>
89
 
90
  ``` cpp
91
  virtual const char* name() const noexcept = 0;
92
  ```
93