Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-11-17 12:08:30


From: "Jeff Garland" <jeff_at_[hidden]>
> > FWIW, I much prefer well-defined what() strings
("boost::pointer_conflict")
> > that I can use as keys into a message table over implementation-defined
> > descriptive messages.
>
> I don't I agree with this. While I have no issue with your desire
> to have implementation defined descriptive messages...

Oops, ambiguous parse tree.

I much prefer

   well-defined what() strings

over

   implementation defined descriptive messages.

:-)

"Well defined" means:

char const * my_exception::what() const throw();

Returns: "my_exception"

"Implementation defined" means

char const * my_exception::what() const throw();

Returns: an implementation defined string that describes what happened.

> ... we can't expect
> all libraries (eg: non-boost) that throw std::exception to follow
> this policy.

You are right, we can't reasonably expect that. This IMO is a defect in the
standard. I'd definitely think twice before showing an implementation
defined string to the user; sometimes the result looks very unprofessional.
:-)

Whether the right solution is to fix what() or to introduce a separate
function is another matter, of course.


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