The first is a lambda without a list of parameters and a subsequent call. []{} equivalent to [](){} , so the whole line is equivalent
[](){}();
The second is a pair of curly braces that enter and then immediately close the area, followed by the unused lambda definition without a list of parameters:
{ // empty scope } []{}; // lambda
You can refer to http://en.cppreference.com/w/cpp/language/lambda for lambda definition syntax options.
Andrew Jun 20 '16 at 12:29 2016-06-20 12:29
source share