小编Tmp*_*plt的帖子

std :: bind到包含多种std :: function类型的std :: variant

I'm playing around with callback functions and wish to register multiple functions via std::bind that differ in signatures (altough they all return void). Assigning the result of the std::bind to the std::variant yields in a "conversion to non-scalar type" error. Is it an ambiguity error? Can I provide the compiler with more information?

Dropping the std::bind (which allows the assignment) is not an option as I wish to register the callbacks using some

template <typename Function, typename... Args>
void …
Run Code Online (Sandbox Code Playgroud)

c++ std-function c++17 std-variant

10
推荐指数
2
解决办法
222
查看次数

标签 统计

c++ ×1

c++17 ×1

std-function ×1

std-variant ×1