Do we have closures in C++?

前端 未结 6 598
慢半拍i
慢半拍i 2020-12-13 02:19

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++?

6条回答
  •  清歌不尽
    2020-12-13 02:41

    Yes, C++11 has closures named lambdas.

    In C++03 there is no built-in support for lambdas, but there is Boost.Lambda implementation.

提交回复
热议问题