#include <iostream>
#include <functional>
#include <string>

using namespace std;

class foo
{
public:
        void setEmail(string s) { cout << "setEmail: " << s << endl; }
        void setPassword(string s) { cout << "setPassword: " << s << endl; }
        void setName(string s) { cout << "setName:" << s << endl; }
        void setAddress(string s) { cout << "setAddress:" << s << endl; }
        void setPhone(string s) { cout << "setPhone:" << s << endl; }
};

typedef std::function<void (string)> fptr;

int main()
{
        foo *newAC = new foo;

        std::function<void (string)> functions[5] = {
                bind(&foo::setEmail,    newAC, placeholders::_1),
                bind(&foo::setPassword, newAC, placeholders::_1),
                bind(&foo::setName,     newAC, placeholders::_1),
                bind(&foo::setAddress,  newAC, placeholders::_1),
                bind(&foo::setPhone,    newAC, placeholders::_1),
        };

        for (int i = 0; i < 5; i++)
                functions[i]("YA");

        return 0;
}