How to make template parameter

后端 未结 2 1054
情书的邮戳
情书的邮戳 2021-01-15 19:14

How do I create a metafunction that takes any kind of function pointer? In the code below, how do I get rid of \"decltype(&f)\" ?

template 

        
2条回答
  •  情书的邮戳
    2021-01-15 19:45

    You can use this:

    template 
    void runFunc(FuncType functionPointer )
    {
        functionPointer();
    }
    
    runFunc(f);
    

提交回复
热议问题