
20 Aug
2007
20 Aug
'07
8:08 p.m.
AMDG Giovanni Piero Deretta <gpderetta <at> gmail.com> writes:
The problem is that ScopeExit relies on local structs which can't be used in templates.
If you look at Implementation section ( http://tinyurl.com/2gerqy ) you'll notice params_1_t and scope_exit_body_t local structures.
Though, I see how it can be avoided: (void*) new params_1_t(...).
The local structs are not essential. You can use tuples. I too would definitely like to see something like int main() { int i = 0; BOOST_LOCAL_FUNCTION(f, (i), (int, v)) { i = v; } BOOST_LOCAL_FUNCTION_END; f(2); // i = 2 } In Christ, Steven Watanabe