I have a class which works with files, the constructor is receiving a std::function for sending the status of the work to a GUI Library if used.
Declaration:
DASM(std::string filename, std::function<void(unsigned int, unsigned int)> f = nullptr);
in the definition I have wrote:
if(f!=nullptr)
f(i,decodedInstructionsCount);
my LoadWindow has following function:
std::function<void(unsigned int,unsigned int)> get_f()
{
std::function<void(unsigned int,unsigned int)> ret = std::bind(&LoadWindow::pb_next,_2,_1);
return ret;
}
and the void LoadWindow::pb_next looks like this:
void LoadWindow::pb_next(unsigned int now, unsigned int max)
{
this->m_progressbar.set_fraction(((double)now/(double)max));
}
VC++ says:
error C2064: Expression does not resolve in a function which accepts 2 arguements.
I have a German VS so I translated the error.
Thank you for Help