Can a lambda expression be passed as function pointer?

后端 未结 5 2017
忘掉有多难
忘掉有多难 2021-02-05 02:49

I am trying to pass a lambda expression to a function that takes a function pointer, is this even possible?

Here is some sample code, I\'m using VS2010:

         


        
5条回答
  •  感动是毒
    2021-02-05 03:18

    In VC10 RTM, no - but after the lambda feature in VC10 was finalized, the standard committee did add language which allows stateless lambdas to degrade to function pointers. So in the future this will be possible.

提交回复
热议问题