假设我有以下函数指针 typedef:
using FType = int(*)(int,int);
Run Code Online (Sandbox Code Playgroud)
如何std::function使用 的签名构造对象FType?
例如,如果使用 FType 定义using FType = int(int,int),则可以通过以下方式完成std::funtion<FType> func = ...
using FType = int(*)(int,int);
std::function<std::remove_pointer_t<FType>> func;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
105 次 |
| 最近记录: |