c++11 - 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 (t::*method) mean? know what's t here. never seen *method . preceding * has got me confused.
  2. the function body seems pretty complicated. love understand syntactically breaking down each part. looks me lambda though.

  1. what (t::*method) mean? know what's t here. never seen *method . preceding * has got me confused.
 future<r> (t::*method)() 

is member function pointer parameter named method. it's expected address of member function of t signature future<r> func();.

  1. the function body seems pretty complicated. love understand syntactically breaking down each part. looks me lambda though.

it lambda function call, yes. lambda body calls dispatch() , passes on pid , method parameters.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -