How to make template parameter

后端 未结 2 934
情书的邮戳
情书的邮戳 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:39

    Right now there is unfortunately no good way of doing this.

    The standard committee has, however, accepted a proposal that makes this valid code:

    template 
    void runFunc() {
      functionPointer();
    }
    

    Compiler support should be coming soon.

提交回复
热议问题