Boost logo

Boost :

From: Daniel Wallin (daniel_at_[hidden])
Date: 2007-08-22 03:33:12


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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk