C++0x has two predefined error_category
objects: generic_category()
and system_category()
. From what I have understood so far, system_category()
should be used for errors returned by the operating system, and generic_category()
should be used for the generic values found in std::errc
, which correspond to errno
values.
However, what should be done on Unix-like systems, where errno
values are the errors returned by the operating system? Should I use system_category()
(which would be wrong on non-Unix-like systems, needing an #ifdef
), or should I use generic_category()
(which would be wrong on Unix-like systems for non-standard errno
values)?