Boost logo

Boost :

Subject: Re: [boost] [exception] uncaught_exception_count, scope(failure), scope(success)
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2013-02-05 15:40:23


On Tue, Feb 5, 2013 at 11:11 AM, Evgeny Panasyuk
<evgeny.panasyuk_at_[hidden]> wrote:
> uncaught_exception_count allow us to implement scope(failure) and
> scope(success) features from D language in C++. ( previous discussion is at
> http://boost.2283326.n4.nabble.com/scope-exit-D-style-scope-failure-and-scope-success-in-C-td4636441.html

I'm not an expert on D but Google tells me that it doesn't support
automatic deterministic termination. So, if you have a file or a
handle open, you need scope(exit) to close it. It also means that the
programmer must keep track of all non-memory resources and dispose
them "manually" like a C programmer.

In C++, RAII makes scope(exit) unnecessary, and catch(...) is the same
as scope(failure).

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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