Please explain the significance of []() in C++

  c++

I am building some HTML forms handlers using ESP32 in Arduino.

In a lot of tutorials I see something like the following…

update_server.on("/", HTTP_GET, []() {
    blah;
    blah;
 });

And here is another..

update_server.on("/update", HTTP_POST, []() {
    blah;
    blah;
}, []() {
    more blah;
    etc... 
});

Can someone please explain to me the [] and the () parts?

I have some vague feeling about these representing function calls, but I am having trouble finding references to this particular syntax.

Thanks, Mark.

Source: Windows Questions C++

LEAVE A COMMENT