
14 Jan
2009
14 Jan
'09
1:41 p.m.
Giovanni Piero Deretta <gpderetta <at> gmail.com> writes:
Why declare the captured variables at all? What is the benefit? In c++0x this should be possible:
BOOST_SCOPE_EXIT { //code here }
// Capture all local variables inside the block by reference: BOOST_SCOPE_EXIT(&) { } // Capture all local variables inside the block by value: BOOST_SCOPE_EXIT(=) { } // Capture a and b by reference, c by value, // all other local variables by reference BOOST_SCOPE_EXIT(&, &a, &b, c) { } // Capture a and b by reference, c by value, // all other local variables by value BOOST_SCOPE_EXIT(=, &a, &b, c) { } Alex