This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
[syserr.errcode.constructors]
# 19 Diagnostics library [[diagnostics]](./#diagnostics)
## 19.5 System error support [[syserr]](syserr#errcode.constructors)
### 19.5.4 Class error_code [[syserr.errcode]](syserr.errcode#constructors)
#### 19.5.4.2 Constructors [syserr.errcode.constructors]
[🔗](#lib:error_code,constructor)
`error_code() noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1064)
*Effects*: Initializes *val_* with 0 and *cat_* with &system_category()[.](#1.sentence-1)
[🔗](#lib:error_code,constructor_)
`error_code(int val, const error_category& cat) noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1076)
*Effects*: Initializes *val_* with val and *cat_* with &cat[.](#2.sentence-1)
[🔗](#lib:error_code,constructor__)
`template<class ErrorCodeEnum>
error_code(ErrorCodeEnum e) noexcept;
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1089)
*Constraints*: [is_error_code_enum_v](system.error.syn#lib:is_error_code_enum_v "19.5.2Header <system_­error> synopsis[system.error.syn]")<ErrorCodeEnum> is true[.](#3.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1093)
*Effects*: Equivalent to:error_code ec = make_error_code(e);
assign(ec.value(), ec.category());

View File

@@ -0,0 +1,56 @@
[syserr.errcode.modifiers]
# 19 Diagnostics library [[diagnostics]](./#diagnostics)
## 19.5 System error support [[syserr]](syserr#errcode.modifiers)
### 19.5.4 Class error_code [[syserr.errcode]](syserr.errcode#modifiers)
#### 19.5.4.3 Modifiers [syserr.errcode.modifiers]
[🔗](#lib:assign,error_code)
`void assign(int val, const error_category& cat) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1110)
*Postconditions*: *val_* == val and *cat_* == &cat[.](#1.sentence-1)
[🔗](#lib:operator=,error_code)
`template<class ErrorCodeEnum>
error_code& operator=(ErrorCodeEnum e) noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1122)
*Constraints*: [is_error_code_enum_v](system.error.syn#lib:is_error_code_enum_v "19.5.2Header <system_­error> synopsis[system.error.syn]")<ErrorCodeEnum> is true[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1126)
*Effects*: Equivalent to:error_code ec = make_error_code(e);
assign(ec.value(), ec.category());
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1134)
*Returns*: *this[.](#4.sentence-1)
[🔗](#lib:clear,error_code)
`void clear() noexcept;
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1145)
*Postconditions*: value() == 0 and category() == system_category()[.](#5.sentence-1)

View File

@@ -0,0 +1,32 @@
[syserr.errcode.nonmembers]
# 19 Diagnostics library [[diagnostics]](./#diagnostics)
## 19.5 System error support [[syserr]](syserr#errcode.nonmembers)
### 19.5.4 Class error_code [[syserr.errcode]](syserr.errcode#nonmembers)
#### 19.5.4.5 Non-member functions [syserr.errcode.nonmembers]
[🔗](#lib:make_error_code,errc)
`error_code make_error_code(errc e) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1216)
*Returns*: error_code(static_cast<int>(e), generic_category())[.](#1.sentence-1)
[🔗](#lib:operator%3c%3c,error_code)
`template<class charT, class traits>
basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const error_code& ec);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1228)
*Effects*: Equivalent to: return os << ec.category().name() << ':' << ec.value();

View File

@@ -0,0 +1,64 @@
[syserr.errcode.observers]
# 19 Diagnostics library [[diagnostics]](./#diagnostics)
## 19.5 System error support [[syserr]](syserr#errcode.observers)
### 19.5.4 Class error_code [[syserr.errcode]](syserr.errcode#observers)
#### 19.5.4.4 Observers [syserr.errcode.observers]
[🔗](#lib:value,error_code)
`int value() const noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1159)
*Returns*: *val_*[.](#1.sentence-1)
[🔗](#lib:category,error_code)
`const error_category& category() const noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1170)
*Returns*: **cat_*[.](#2.sentence-1)
[🔗](#lib:default_error_condition,error_code)
`error_condition default_error_condition() const noexcept;
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1181)
*Returns*: category().default_error_condition(value())[.](#3.sentence-1)
[🔗](#lib:message,error_code)
`string message() const;
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1192)
*Returns*: category().message(value())[.](#4.sentence-1)
[🔗](#lib:operator_bool,error_code)
`explicit operator bool() const noexcept;
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1203)
*Returns*: value() != 0[.](#5.sentence-1)

View File

@@ -0,0 +1,31 @@
[syserr.errcode.overview]
# 19 Diagnostics library [[diagnostics]](./#diagnostics)
## 19.5 System error support [[syserr]](syserr#errcode.overview)
### 19.5.4 Class error_code [[syserr.errcode]](syserr.errcode#overview)
#### 19.5.4.1 Overview [syserr.errcode.overview]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1009)
The class error_code describes an object used to hold error code
values, such as those originating from the operating system or other low-level
application program interfaces[.](#1.sentence-1)
[*Note [1](#note-1)*:
Class error_code is an
adjunct to error reporting by exception[.](#1.sentence-2)
— *end note*]
[🔗](#lib:error_code)
namespace std {class error_code {public:// [[syserr.errcode.constructors]](syserr.errcode.constructors "19.5.4.2Constructors"), constructors error_code() noexcept;
error_code(int val, const error_category& cat) noexcept; template<class ErrorCodeEnum> error_code(ErrorCodeEnum e) noexcept; // [[syserr.errcode.modifiers]](syserr.errcode.modifiers "19.5.4.3Modifiers"), modifiersvoid assign(int val, const error_category& cat) noexcept; template<class ErrorCodeEnum> error_code& operator=(ErrorCodeEnum e) noexcept; void clear() noexcept; // [[syserr.errcode.observers]](syserr.errcode.observers "19.5.4.4Observers"), observersint value() const noexcept; const error_category& category() const noexcept;
error_condition default_error_condition() const noexcept;
string message() const; explicit operator bool() const noexcept; private:int *val_*; // *exposition only*const error_category* *cat_*; // *exposition only*}; // [[syserr.errcode.nonmembers]](syserr.errcode.nonmembers "19.5.4.5Non-member functions"), non-member functions error_code make_error_code(errc e) noexcept; template<class charT, class traits> basic_ostream<charT, traits>&operator<<(basic_ostream<charT, traits>& os, const error_code& ec);}