【发布时间】:2018-04-20 10:19:00
【问题描述】:
我有以下函数声明:
void get_data(struct myStruct* const value, const void * const data);
我有另一个函数,我想添加一个std::function 作为参数:
// I think the std::function definition is where my problem is
template<typename MyType>
void process(bool test, std::function<void(MyType* const, const void* const)>& callb) { ... }
但是我不太清楚如何调用它,或者我上面的定义是否正确:
bool test1 = true;
process<myStruct>(test1, get_data);
编译器错误:
错误:‘void process(bool, std::function有什么想法吗?
【问题讨论】:
-
您是否遇到编译器错误?
-
@arias_JC,编译器错误在哪里?
-
@arias_JC 请编辑您的问题以包含您遇到的错误
-
添加编译器错误