How can I operate std::async call on a member function?
Example:
class Person{
public:
void sum(int i){
cout << i << endl;
}
};
int main(int argc, char **argv) {
Person person;
async(&Person::sum,&person,4);
}
I want to call to sum async.
Person p;
call async to p.sum(xxx)
I didnt figure out if i can do it with std::async.
Dont want to use boost.
Looking for a one line async call way.
Something like this:
or
where
pis aPersoninstance andxxxis anint.This simple demo works with GCC 4.6.3: