Search code examples
c++closureslexical-closures

Do we have closures in C++?


I was reading about closures on the net. I was wondering if C++ has a built-in facility for closures or if there is any way we can implement closures in C++?


Solution

  • The latest C++ standard, C++11, has closures.

    http://en.wikipedia.org/wiki/C%2B%2B11#Lambda_functions_and_expressions

    http://www.cprogramming.com/c++11/c++11-lambda-closures.html