I have two classes. One class has a method that takes a function as a parameter and that passed function is expected to have a string as an argument. For example:
class Dog{
public:
void doDogThings(std::function <void(std::string)> theFunction);
}
class Cat{
public:
void doCatThings(std::string stringInput);
}
And here they are in action
int main(){
Cat aCat;
Dog aDog;
std::string theString = "Oh jeez";
aDog.doDogThings(<< insert cat's method and argument here >>);
.....
This is the part that is fouling me up here; I know I should use
bind(&Cat::doCatThings, ref(aCat) ....?.....);
But I am stuck on how to pass the argument for the Cat method as a parameter to this function pointer. Any help would be greatly be appreciated. Thanks.