15 May
2013
15 May
'13
4:59 p.m.
Oliver Kowalke wrote:
void g( Q< std::string > &) {...} X x( g); x.run(); // call g() with an instance of Q< std::string > as arg
struct W { void h( Q< int > &) {...} }; W w; X x( bind( & W::h, w, _1) ); x.run(); // call W::h() with an instance of Q< int > as arg
Interesting. Can't you get away with just passing the type to X, or even the Q<> value itself? X x( fn, Q<int>() ); Otherwise, your problem doesn't have a solution in general, consider struct Fn { template<class T> void operator()( Q<T> & qt ); };