Boost logo

Boost :

From: Kevin Spinar (spinarkm_at_[hidden])
Date: 2006-07-06 23:39:35


On 7/6/06, Emil Dotchevski <emildotchevski_at_[hidden]> wrote:
>
> Oleg Abrosimov wrote:
>
> > It can be rewritten as follows:
> >
> > if( count!=fread(buffer,size,count,stream.get()) ||
> > ferror(stream.get()) ) boost::throw_<fread_error>() <<
> > boost::wrap_string<tag_function>("fread") <<
> > boost::wrap_errno() <<
> > boost::weak_ptr<FILE>(stream);
> > }
>
> Yes, but what happens if boost::wrap_string throws?
>

Similarily:

throw std::runtime_error("my error");

What happens if std::runtime_error's constructor throws? (a temporary
std::string is created so the dynamic allocation could cause std::bad_alloc
to be thrown)

Apparently people consider this a non-issue. And so, it seems the fact that
boost::wrap_string could throw is also a non-issue.

Kevin Spinar


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