C++0x lambda, how can I pass as a parameter?

后端 未结 3 904
独厮守ぢ
独厮守ぢ 2020-12-10 12:02

Please look at the following C++0x lambda related code:

typedef uint64_t (*WEIGHT_FUNC)(void* param);
typedef std::map Callba         


        
3条回答
  •  时光取名叫无心
    2020-12-10 12:32

    Try with (not tested) :

    #include 
    
    typedef std::function< int64_t (void*) > weight_func;
    typedef std::map CallbackTable;
    

    I don't think there is any other way to do this than to use std::function or equivalent.

提交回复
热议问题