System errors

The <system_error> library defines a series of classes to encapsulate system errors. The error_category class provides a mechanism to convert numeric error values into localized descriptive strings. Two objects are available through the generic_category and system_category functions in <system_error>, and <ios> has a function called isostream_category; all of these functions return an error_category object. The error_category class has a method called message that returns a string description of the error number you pass as the parameter. The object returned from the generic_category function will return the descriptive string for a POSIX error, so you can use it to get a description for an errno value. The object returned from ...

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.