Wednesday, 19 July 2017
lambda - Advanced C++ multiple parentheses
Answer
Answer
I'm reviewing a sample program code and found this line:
auto prerequisite = task([](){});
What is the meaning of those combined parentheses ([](){})
I'm a cpp programmer but do not know advance cpp (c11+) which this Microsoft example is written at. Googling didn't help, and I don't know the name of those operators.
Answer
[](){} is a lambda expression that creates a function object that has non-zero size and does nothing.
This is probably to avoid checking whether prerequisite is valid/exists - it is always valid, but may do nothing.
Subscribe to:
Post Comments (Atom)
casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV
In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...
-
Parse error: syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' ...
-
I'm using Simple HTML DOM to extract data from a HTML document, and I have a couple of issues that I need some help with. On the line th...
-
I've just started to learn CodeIgniter and gotten trouble with example below: My Controller: class Site extends CI_Controller ...
No comments:
Post a Comment