Delegate in C++11

后端 未结 5 873
悲&欢浪女
悲&欢浪女 2021-02-14 00:09

Does C++11 provide delegates?

If not, what is the best (most efficient) way to do something similar in C++? Boost.Signals? FastDelegate? Something else?

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-14 00:20

    Though std::function works nicely, I would like to point out this nice piece of delegate code, written here (including example usage!). Following the references and answers there you can read all about how this Delegate class is constructed and why it may be faster than std::function.

    Note also my question here for a problem I encountered with it on VS 2015.

提交回复
热议问题