
Alexander Nasonov wrote:
Could it just take arguments by value and use boost::ref for references like the other function-like libraries?
Andrey Semashev <andysem <at> mail.ru> writes:
I thought of it too, but I couldn't imagine the way to implement it. One would like to put "ref(arg)" into scope-exit arguments list, and I don't see the way to extract "arg" portion from this string to name the argument.
If you're referring to this syntax
BOOST_SCOPE_EXIT( byref(r) byval(v) )
than it's probably possible but I'm not an exprert in PP.
Boost.Parameter does something similar to this with "out(name)". It can also detect "static" in front of a name and strip it. So both the above syntax and something like: BOOST_SCOPE_EXIT((ref x)(ref v)) should be possible. -- Daniel Wallin Boost Consulting www.boost-consulting.com