I'm trying to use lambda expressions from the new standard and still don't understand them well enough.
Say I have a lambda somewhere in my code, for example. in my main:
int main( int argc, char * argv[]) { //some code [](int x, int y)->float { return static_cast<float>(x) / static_cast<float>(y); }; //some more code here //<---now I want to use my lambda-expression here }
Well, obviously, I might have to use it several times, so the answer βjust define it right thereβ does not work: P So, how can I call this lambda expression later in the code? Should I make a pointer to it and use this pointer? Or is there a better / easier way?
source share