22 Diagnostics library [diagnostics]

22.5 System error support [syserr]

22.5.2 Class error_­category [syserr.errcat]

22.5.2.5 Error category objects [syserr.errcat.objects]

const error_category& generic_category() noexcept;
Returns: A reference to an object of a type derived from class error_­category.
All calls to this function shall return references to the same object.
Remarks: The object's default_­error_­condition and equivalent virtual functions shall behave as specified for the class error_­category.
The object's name virtual function shall return a pointer to the string "generic".
const error_category& system_category() noexcept;
Returns: A reference to an object of a type derived from class error_­category.
All calls to this function shall return references to the same object.
Remarks: The object's equivalent virtual functions shall behave as specified for class error_­category.
The object's name virtual function shall return a pointer to the string "system".
The object's default_­error_­condition virtual function shall behave as follows:
If the argument ev corresponds to a POSIX errno value posv, the function shall return error_­condition(posv, generic_­category()).
Otherwise, the function shall return error_­condition(ev, system_­category()).
What constitutes correspondence for any given operating system is unspecified.
[Note
:
The number of potential system error codes is large and unbounded, and some may not correspond to any POSIX errno value.
Thus implementations are given latitude in determining correspondence.
end note
]