0
votes
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
The first one should work, but would work better without the redundant type. - chris
The first argument to bind needs to be some sort of function. LPVOID hardly fits that requirement. - jrok
Can you post the declaration of fn ? - woolstar
Consider storing a lambda functor instead of a ::std::bind functor. - user1095108

1 Answers

2
votes

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.