|
|
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> What's the type of
>> [&](int x) { total += x; }
>
>> What kind of variable can I assign that to?
>
> You don't have to know the type (and in fact, the type is unspecified).
> You create a variable like this:
>
> auto myLambdaFunc = [&](int x) { total += x; };
And when you return that from the function as the function's value, what
happens with the free variables? How do you declare the function that ends
execution with "return myLambdaFunc"? How do you make it a part of a structure?
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
|