Boost logo

Boost :

From: Andrey Semashev (andysem_at_[hidden])
Date: 2007-08-22 01:05:27


Hello Michael,

Wednesday, August 22, 2007, 6:02:29 AM, you wrote:

> Andrey Semashev wrote:
>>
>> - The scope-exit block arguments are taken by reference. I consider
>> this as a drawback because it is most often desirable to fix the
>> environment state at the point where the guard is created. The most
>> frequent and, in majority, the only exception to this is the
>> "commit/dispose" flag. Playing otherwise may lead to subtle errors.
>>

> Could it just take arguments by value and use boost::ref for references
> like the other function-like libraries?

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.

-- 
Best regards,
 Andrey                            mailto:andysem_at_[hidden]

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