I have a class named Graph, in this class I have a member named V, it is a vector. I have a struct named Edge, and a list of Edges. like below:
struct Edge{
int u;
int v;
Edge(int u,int v){
this->u=u;
this->v=v;
}
};
struct Vertex{
int d;
int f;
.
.
.
}
class Graph{
vector < Vertex > V;
.
.
.
int edgeCmp(Edge* x,Edge* y){
return ( V[x->v].d < V[y->v].d )?1:0;
}
void someFunction(){
list<Edge> backEdges;
backEdges.sort(&Graph::edgeCmp);
}
}
But it doesn't work!! may someone help me to do such a thing? I get this error:
Error 3 error C2064: term does not evaluate to a function taking 2 arguments c:\program files\microsoft visual studio 9.0\vc\include\xutility 346
It can't understand I'm calling the function which takes 2 arguments. I don't know why.