Boost logo

Boost :

From: Geoff Leyland (gley001_at_[hidden])
Date: 2004-02-10 02:01:12


On 10/02/2004, at 6:54 PM, Jonathan Turkanis wrote:

> I think boost should encourage best practices, not practices which
> work acceptably only in limited circumstances without providing
> substantial benefits.

Fair call.

> For miscellaneous errors, you can use one the
> standard exception classes, such as runtime_error, using a
> stringstream to format the results, if you like:
>
> stringstream s;
> s << "somebody made " << x << " mistakes";
> throw runtime_error(s.str());
>
> This gives you the results you want, doesn't it? Is it really that
> inconvenient?

Oh, well I'm alright, because I'll go on using my streamy exception
where I think it's warranted.

Convenience is an interesting question though. To some extent (no
offence to the authors of excellent libraries that I use a lot and am
extremely grateful for) my use of boost::lambda and boost::bind amounts
to avoiding the inconvenience of hand writing function objects - but I
wouldn't want to live without them.

Funny that gcc's runtime_error uses a string copy constructor that
could potentially throw :-)

cheers,
Geoff


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