
On 7/6/06, Emil Dotchevski <emildotchevski@hotmail.com> 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