|
Boost Users : |
Subject: Re: [Boost-users] Scope exit with no capture
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-11-22 16:34:00
Le 22/11/11 21:12, Bruno Martínez a écrit :
> Hi,
>
> How can I call BOOST_SCOPE_EXIT when no variable needs to be captured?
>
> BOOST_SCOPE_EXIT ()
> {
> CoUninitialize();
> } BOOST_SCOPE_EXIT_END;
>
> doesn't work. I tried
>
> BOOST_SCOPE_EXIT (BOOST_PP_NIL)
> BOOST_SCOPE_EXIT (BOOST_PP_EMPTY)
> BOOST_SCOPE_EXIT (BOOST_PP_SEQ_NIL)
>
> but they don't work either.
>
>
Hi,
I think that Boost.ScopedExit needs at least to capture a variable.
Boost.Local (which is currently reviewed) provides a similar feature
that allows to pass void to mean no capture.
I guess this feature will be integrated in ScopedExit soon :), but in
order to don't forget, maybe you could create a feature request on the
Trac system.
Best,
Vicente
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net