struct vertex //object in the list
{
int data ;
list <edge*> edges ;
};
list <vertex> thenodes ;
//user defined function object
struct checking : public binary_function <vertex,int,bool>
{
bool operator()(const vertex &a,int b)
{
return (a.data == b) ;
}
};
//the function using the find_if function
list <vertex>::iterator findv(int thing)
{
list <vertex>::iterator result ;
result = find_if(thenodes.begin(),thenodes.end(),bind2nd(checking(),thing)) ;
return result ; //the problem
}
this code is from a graph code , the problem is not the graph, but the using of the user defined functor checking() with the bind2nd() function in the find_if function , the microsoft compiler give me an error of :
cannot convert 'this' pointer from 'const struct graph::checking' to 'struct graph::checking &' // so what is the problem ???
note : the problem may be easy coz i am just a beginer