pass function by value (?) instead of function pointer?

前端 未结 4 2175
醉酒成梦
醉酒成梦 2020-12-18 22:28

Sorry if this has been asked before, but I was unable to find it.

So im trying to educate myself about templates and the new C++11 features (mainly lambdas, somethin

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 22:55

    Functions are implicitly convertible to function pointers. If fact there is no way to get a function value or reference. Though oddly you can create a function value type, you just can't assign anything to it.

    Here is code snippit that demonstrates how lambdas and various callbacks react with templates.

提交回复
热议问题