Skip navigation.
Home
l'art pour l'art

Lambda functions and closures are now part of C++0x

See all entries for

I just read that Lambda functions and closures are now part of C++0x. Once The GNU C++ Compiler supports these, I will redesign the current CPP+Signal'n Slots based closure syntax.

This means that

TCLOSURE2(
  slider,sigChanged,
  _this, this,
  _slider, slider,
  _this->setValue(_slider->getValue());
)

is going to look like

slider->sigChanged->connect([] { this->setValue(slider->getValue()); });

in the future.