Klasa i std :: async na elemencie klasy w C ++

Próbuję napisać element klasy, który wielokrotnie wywołuje innego członka klasy równolegle.

Napisałem prosty przykład problemu i nie mogę nawet tego skompilować. Co robię źle z wywołaniem std :: async? Myślę, że problem polegałby na tym, jak przekazuję tę funkcję.

#include <vector>
#include <future>
using namespace std;
class A
{

int a,b;
public: 
A(int i=1, int j=2){ a=i; b=j;} 

std::pair<int,int> do_rand_stf(int x,int y)
{
    std::pair<int,int> ret(x+a,y+b);
    return ret;
}

void run()
{
    std::vector<std::future<std::pair<int,int>>> ran;
    for(int i=0;i<2;i++)
    {
        for(int j=0;j<2;j++)
        {
            auto hand=async(launch::async,do_rand_stf,i,j);
            ran.push_back(hand);    
        }
    }
    for(int i=0;i<ran.size();i++)
    {
        pair<int,int> ttt=ran[i].get();
        cout << ttt.first << ttt.second << endl;
    } 
}
};
int main()
{
A a;
a.run();
}

kompilacja:

g++ -std=c++11 -pthread main.cpp 

questionAnswers(2)

yourAnswerToTheQuestion