
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. 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"); To extract the string from an exception_info object, you'd do this: exception_info & xi; if( std::string const * s = exception_string<tag>(xi) ) .... Similarly, it makes sense to rename both wrap_errno/get_errno to exception_errno. Thanks for everyone's input! --Emil

On 7/10/06, Emil Dotchevski <emildotchevski@hotmail.com> 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
participants (2)
-
Dean Michael Berris
-
Emil Dotchevski