Hey all.
While googling I found some code like this.
void SomeFunction()
{
auto check = [&](int v1, int v2)-> int
{
//do stuff say add the 2 values
return v1 + v2;
};
//used say in a ???
int rt = check(34, 8);
}
Is this a What??? pointer to a defined function.
and is it wise to do things like this or does it have a impact on code speed or any other overhead.
Because after seeing it I found a place I could use it which would allow me to keep it all in one function.
Any input would be good thank.
What I want to use it for is I have a function FindFreeCell and it has a std::list I use as a ordered list and may addToList could be setout like above.