
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@mail.ru