Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-14 08:34:28


From: "Beman Dawes" <bdawes_at_[hidden]>
>
> Operating systems provide useful information (error descriptions
translated
> into the local language, for example) which are easy to supply as readable
> strings as part of the exception, and hard for users to supply (because
the
> user code would be non-portable).

I think that if you expose the unnamed-namespaced

std::string system_message( int sys_err_code );

the users will be able to simply say

system_message(e.native_error())

and there's nothing non-portable in that.

It still seems to me that it is std::strerror that should be able to turn an
error code into a string, regardless of whether this error code has been
returned from the C runtime, the filesystem library, or the threading
library, but I understand the reasons to avoid it. The ubiquitous "novice
C++ users" will never buy the reasons, though. "Five different code to
message functions? What were they _thinking_??"


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk