我试图编写一个模板函数,它可以接受函子作为参数,然后调用它。/include a.cpp -o a.oa.cpp:16:38: error: no matching function for callArgs> R call(std::function<_Res(_ArgTypes ...)>, Args ...)
a.cpp:7:3: note: te
return fn(val);我希望能够使用函数指针、函数器、lambda等来调用unary_apply :因此使用std::function来抽象所有这些。/fun.cpp:147:75: note: ‘test()::<lambda(int)>’ is not derived from ‘std::function<ResT(double)>’
我发现我必须显式地指定模板参数(实际上,我认为这只是不可<e