小编Kir*_*dia的帖子

具有模板参数的typedef函数指针

我想为具有模板作为参数的方法签名创建函数指针

Template<class T>
typedef int (*computeSizeFunc)(T data);
Run Code Online (Sandbox Code Playgroud)

我试过了,这是错误

 error: template declaration of 'typedef'
 typedef  int (*computeSizeFunc)(T data).
Run Code Online (Sandbox Code Playgroud)

这是我尝试为其编写函数指针的方法签名

template<class T>
int getSize (T data)
Run Code Online (Sandbox Code Playgroud)

c++ c++11

0
推荐指数
1
解决办法
60
查看次数

标签 统计

c++ ×1

c++11 ×1