Agoston Bejo wrote:
Hi! A small example:
-------------------------------- template
bool equ(T1 t1, T2 t2, double threshold) { return t1 == t2; } int _tmain(int argc, _TCHAR* argv[]) { int ia1[] = {1,2,3,4,5}; cout << *find_if(ia1, ia1+5, bind<bool>(equ
, _1, 5)) << endl; // ERROR return 0; } ----------------------------------- Compiler: VC++7.1 (Intermezzo: another question: why do I have to specify the result type for bind in this case (bool)? Why can't it deduce it from the template function declaration: the return type is non-dependent.)
'equ' takes three arguments, but you are passing two, _1 and 5. The <bool> silences the error that bind would have reported because of this and postpones it until an actuall call is made to equ with two arguments.