I have two class member functions to get bind. I have to pass placeholders, because the second class will set the arguments by themself.
Let's say I have a class
class slave
{
public:
void func1();
void func2(bool a, bool b);
};
and a second class
class master
{
public:
std::function<void(void)> func1;
std::function<void(bool, bool)> func2;
};
I can bound func1 und func2 like this
master Master;
slave Slave;
Master.func1 = std::bind(&slave::func1, &Slave);
Master.func2 = std::bind(&slave::func2, &Slave, true, false);
but how can I bind with placeholders?
without binding to a class member function I just can write:
std::function<void(bool, bool)> func2;
func2 = std::bind(&slave::func2, &Slave, std::placeholders::_1, std::placeholders::_2);
but I can't write
Master.func2 = std::bind(&slave::func2, &Slave, std::placeholders::_1, std::placeholders::_2);
How can I use placeholders for binding between class member functions?