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); }); } - what
(t::*method)mean? know what'sthere. never seen*method. preceding*has got me confused. - the function body seems pretty complicated. love understand syntactically breaking down each part. looks me lambda though.
- 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();.
- 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
Post a Comment