Files
cppdraft_translate/cppdraft/value/error/codes.md
2025-10-25 03:02:53 +03:00

38 lines
1.5 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[value.error.codes]
# 16 Library introduction [[library]](./#library)
## 16.4 Library-wide requirements [[requirements]](requirements#value.error.codes)
### 16.4.6 Conforming implementations [[conforming]](conforming#value.error.codes)
#### 16.4.6.16 Value of error codes [value.error.codes]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/lib-intro.tex#L3969)
Certain functions in the C++ standard library report errors via aerror_code ([[syserr.errcode.overview]](syserr.errcode.overview "19.5.4.1Overview")) object[.](#1.sentence-1)
That object'scategory() member shall return system_category() for
errors originating from the operating system, or a reference to animplementation-defined error_category object for errors originating elsewhere[.](#1.sentence-2)
The implementation shall define the possible values of value() for each of these
error categories[.](#1.sentence-3)
[*Example [1](#example-1)*:
For operating systems that are based on POSIX,
implementations should define the std::system_category() values as
identical to the POSIX errno values, with additional values as defined by the
operating system's documentation[.](#1.sentence-4)
Implementations for operating systems that are not
based on POSIX should define values identical to the operating system's
values[.](#1.sentence-5)
For errors that do not originate from the operating system, the implementation
may provide enums for the associated values[.](#1.sentence-6)
— *end example*]