Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2006-07-10 07:10:26


On 7/10/06, Emil Dotchevski <emildotchevski_at_[hidden]> wrote:
> Hello,
>
> I am contemplating a few minor changes to the exception library and I wanted
> to get some input before I implement them.
>
> First, I think that the function template failed should be renamed. Somehow,
> boost::failed doesn't feel right. Since English is not native to me, I
> really need help with this one.
>

How about boost::exception<> ? I don't know if that already conflicts
with anything already being used in boost, and makes it different from
std::exception -- but in which case, it would be good to have all
boost::exception<> instances drive from std::exception as well, so as
to make it catchable in standard exception handling code. Does that
make sense?

> Second, I'm thinking of renaming wrap_string/get_string. Those names did
> make sense in the implementation I've been using in my own code, because the
> whole thing was in namespace except. Clearly, boost::get_string doesn't
> suggest that it's part of the exception library. I'm thinking of renaming
> them both to exception_string. So, stuffing a string at the time of the
> throw would look like this:
>
> throw failed<foo>() << exception_string<tag>("value");
>

exception_string sounds alright. or perhaps something like a general
"info" could work:

throw boost::exception<foo>() << boost::info_string<tag>("value");
...
throw boost::exception<foo>() << boost::info_errno<tag>(1);

-- 
Dean Michael C. Berris
C/C++ Software Architect
Orange and Bronze Software Labs
http://3w-agility.blogspot.com/
http://cplusplus-soup.blogspot.com/
Mobile: +639287291459
Email: dean [at] orangeandbronze [dot] com

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