Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2003-10-08 15:05:45


Peter Dimov wrote:
>
> Alexander Terekhov wrote:
> > Peter Dimov wrote:
> > [...]
> >> Right. You want to autodetect whether to operate in a throw mode or a
> >> nothrow mode. This will never work. :-)
> >
> > Stop advocating blind use of catch(...), Peter!
>
> _In the current language_ there is _nothing wrong_ with catch(...)+rethrow.
> But I don't advocate it in general, or in the above sentence. I don't know
> what you mean.

To begin with,

http://www.boost.org/libs/smart_ptr/sp_techniques.html

"should be wrapped in a try {} catch(...) {} block that ignores exceptions"

I mean. Now, please click here:

http://groups.google.com/groups?selm=3E76FB8A.A9C88386%40web.de
(Subject: Re: [OT] Re: C++ object locks like Java?)

[...]
> That's quite a different story. What does it mean for a cancel exception to
> be "unexpected", by the way?

fclose() is a "may also occur" cancelation point in POSIX (it does
blatantly violate C++ standard, but "enjoy your life", so to speak).
In C++, you may want to call it inside some destructor that can be
called due to thrown exception (some non-cancel one; cancelation is
disabled once it fires). Will you expect it? I simply say that you
don't necessarily need to disable/restore cancelation in your dtor.
You may simply rely on std::expected_exception<> checking "inside"
fclose().

regards,
alexander.


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