Boost logo

Boost :

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


On Tue, Feb 5, 2013 at 3:25 PM, Evgeny Panasyuk
<evgeny.panasyuk_at_[hidden]> wrote:
> 06.02.2013 2:57, Emil Dotchevski:
>> Could you clarify what does uncaught_exceptions_count() use look like?
>> How is it different scope guard?
>
> For instance, check first example at Boost.ScopeExit documentation (C++98
> syntax):
> http://www.boost.org/doc/libs/1_53_0/libs/scope_exit/doc/html/index.html
>
> void world::add_person(person const& a_person) {
> bool commit = false;
>
> persons_.push_back(a_person);
> BOOST_SCOPE_EXIT(&commit, &persons_) {
> if(!commit)
> persons_.pop_back();
> } BOOST_SCOPE_EXIT_END
>
> // ...
>
> commit = true;
> }
>
> Using SCOPE_FAILURE it would became (C++98 syntax):
>
> void world::add_person(person const& a_person) {
> persons_.push_back(a_person);
> SCOPE_FAILURE(&persons_) {
> persons_.pop_back();
> } SCOPE_FAILURE_END
>
> // ...
> }

I was asking specifically how uncaught_exception_count would be used.

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