POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
9 Oct 2024 16:09:58 EDT (-0400)
  Re: Standard libraries  
From: Darren New
Date: 6 Mar 2009 23:07:48
Message: <49b1f314$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.