I would like to call a method after another method using std::function. Suppose i have something like this
class foo
{
std::function<void(int)> fptr;
void bar(int){
}
void rock(std::string){
}
public:
foo() {
fptr = bind(&foo::bar,this,std::place_holder::_1); //<------Statement 1
}
}
Now because of statement 1 if i call fptr(12) the method bar is called. My question is can i specify or manipulate statement 1 so that after bar is called it calles rock. I know i could simply have bar called foo but thats not what i am looking for. Can bind help me accomplish this ?
Aucun commentaire:
Enregistrer un commentaire