1

I'm going through Wt web framework tutorial, in one example they initialize a variable this way:

auto greet = [this]{
  greeting_->setText("Hello there, " + nameEdit_->text());
};

What does square brackets mean in this type of initialization?

Carlos
  • 41
  • 7
  • 4
    That's a [lambda function](https://stackoverflow.com/questions/7627098/what-is-a-lambda-expression-in-c11) – ForceBru Apr 05 '20 at 14:44
  • [What does `[ this ]` mean in C++](https://stackoverflow.com/q/22930154/995714), [Syntax help: Function pointer surrounded by square brackets](https://stackoverflow.com/q/49120037/995714), [What does `[&]` mean before function?](https://stackoverflow.com/q/39789125/995714) – phuclv Apr 05 '20 at 14:46
  • https://fr.cppreference.com/w/cpp/language/lambda – jbrouwer Apr 16 '20 at 15:00

0 Answers0