16 Library introduction [library]

16.5 Library-wide requirements [requirements]

16.5.5 Conforming implementations [conforming]

16.5.5.15 Value of error codes [value.error.codes]

Certain functions in the C++ standard library report errors via a std​::​error_­code object.
That object's category() member shall return std​::​system_­category() for errors originating from the operating system, or a reference to an implementation-defined error_­category object for errors originating elsewhere.
The implementation shall define the possible values of value() for each of these error categories.
Example
:
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.
Implementations for operating systems that are not based on POSIX should define values identical to the operating system's values.
For errors that do not originate from the operating system, the implementation may provide enums for the associated values.
— end example
 ]