|
Boost : |
Subject: Re: [boost] [scope_exit] D-style scope(failure) and scope(success) in C++
From: Evgeny Panasyuk (evgeny.panasyuk_at_[hidden])
Date: 2013-09-26 18:39:53
27.09.2013 1:55, Lorenzo Caminiti:
>> Any progress on this?
>
> As far as I understand it, this cannot be implemented (at least in a
> portable way). See:
I have made platform-specific implementation:
https://github.com/panaseleus/stack_unwinding.
It is tested it on {Clang 3.2, GCC
3.4.6, GCC 4.1.2, GCC 4.4.6, GCC 4.4.7, MSVC2005SP1, MSVC2008SP1,
MSVC2010SP1, MSVC2012} x {x32, x64} and some others
- which fulfils Boost portability requirements(
http://www.boost.org/development/requirements.html#Portability ):
"
A library's implementation must if possible be portable and not
restricted to a particular compiler or operating system. If a portable
implementation is not possible, non-portable constructions are
acceptable if reasonably easy to port to other environments, and
implementations are provided for at least two popular operating systems
(such as UNIX and Windows).
"
I have posted it here twice to different libraries with no success:
1. [boost][scope_exit]:
http://boost.2283326.n4.nabble.com/scope-exit-D-style-scope-failure-and-scope-success-in-C-td4636441.html
2. [boost][exception]:
http://boost.2283326.n4.nabble.com/exception-uncaught-exception-count-scope-failure-scope-success-td4642313.html
It is partly included in Boost.Log since 1.54:
http://ci.boost.org/svn-trac/browser/trunk/libs/log/src/unhandled_exception_count.cpp?rev=85532
.
But for the purposes of scope(failure) and scope(success) it is
preferable to put it as header-only.
If library maintainer of [exception] or [scope_exit] would agree to
integrate uncaught_exception_count - then we may be lucky to get it
released in 1.56.
-- Evgeny Panasyuk
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk