
16 Dec
2009
16 Dec
'09
11:56 p.m.
On Wed, Dec 16, 2009 at 3:56 PM, Mathias Gaunard <mathias.gaunard@ens-lyon.org> wrote:
Andy Venikov a écrit :
I'm not going to debate whether it's right or wrong, but I'm still curious - why did it have to be a template? When bind() is called it already has all the information about the function's signature
Not in the general case. For function pointers or member function pointers, I suppose it is the case though.
struct myFunction { int operator()(char c, int i){...} int operator()(char c, std::string s){...} int operator()(char c, float f){...} } auto b = bind(myFunction, 42, _1); See why the template is useful now?