Boost logo

Boost :

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


From: "Jeff Garland" <jeff_at_[hidden]>
> > Whether the right solution is to fix what() or to introduce a separate
> > function is another matter, of course.
>
> Given that there is lots of existing practice that doesn't meet
> your 'well-defined' standard, it seems that the only option is
> to introduce a separate function.

The wonderful thing about leaving what() implementation-defined is that it
can be tightened to be well-defined for all standard exception classes
without breaking any code, as any code that depends on particular what()
string is already broken. :-)

> Of course, typeinfo might
> be another way, but that's broken for cross-platform
> developments :-(

typeinfo::name() isn't a good general solution, although it's a very good
default. In particular, I'd expect

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

to return f.ex. "ENOMEM" and not "errno_exception".


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