|
Boost : |
From: Emil Dotchevski (emil_at_[hidden])
Date: 2007-10-09 02:15:31
> Hmmm - my code looks like this:
>
> throw some_error() <<
> BOOST_ERROR_INFO <<
> boost::error_info< tag_error_code >( boost::system::error_code( errno,
> boost::system::errno_ec) );
As far as I know the point of the error category in boost::system is
to classify the error code, so that error codes (integers) returned
from different systems can coexist.
I think that with boost exception, a better way to differentiate one
integer (error code) from another is to just use different tags.
In other words, instead of the code above, you'd have:
throw some_error() <<
BOOST_ERROR_INFO <<
boost::error_info<tag_errno>(errno);
where
struct tag_errno: boost::error_info_value<int> { };
Emil Dotchevski
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk