mardi 14 juin 2016

What does this c++ function mean?


template <typename R, typename T>
Deferred<Future<R>()> defer(const PID<T>& pid, Future<R> (T::*method)())
{ 
  return Deferred<Future<R>()>([=]() { return dispatch(pid, method); });
}
  1. what does (T::*method) mean? I know what's T here. But never seen something like *method . The preceding * has got me confused.
  2. The function body seems pretty complicated. I would love to understand it syntactically by breaking down each part. Looks to me like lambda though.

Aucun commentaire:

Enregistrer un commentaire