std::function<void()> constructor with std::bind

596 Views Asked by At
std::function<void()> f = std::function<void()>(std::bind(fn,params));

fn - LPVOID type, params - std::vector I have an error here.C2064:term does not evaluate to a function taking 'number' arguments.

This error arise in functional.h!

I know, that i should better write something like

auto f = std::bind(fn,params);

But my task is to store lots of func pointers in a std::queue.

How can i transorm std::bind() to a specific type (or store "auto" type)?

1

There are 1 best solutions below

0
On BEST ANSWER

error: term does not evaluate to a function taking 'number' arguments

The error message may be referring to your parameter fn which, as a LPVOID, is not a function at all.