
11 Jun
2010
11 Jun
'10
4:17 p.m.
Eric Niebler wrote:
That gives us an opportunity to add a new feature to Phoenix: default capture modes. I could see something like:
ref[ phoenix-lambda-expression ]
makes default capture by-ref, and
val[ phoenix-lambda-expression ]
makes it by-val. Under the hood, Phoenix would actually be storing every captured variable both by value and by reference.
What if the variable is not copyable? Copying is an expensive operation as well, why do it when you don't need to?