D:\programming\project\No_2\CGraph.cpp(83) : error C2664: 'void __thiscall std::list
CVertex *)' to 'struct std::greater
No constructor could take the source type, or constructor overload resolution was ambiguous
程序段部分如下:
class CVertex{
public:
int d;
int p;
int ID;
CVertex(){d = INFINITY; p = NULL;}
~CVertex();
};
bool pVertexComp( CVertex* x,CVertex* y)
{
if ( x->d < y->d ) return true;
else
return false;
}
void CGraph::DijkstraAlg(int s)
{
map
iend = mapVID_Vertex.end();
for( i=mapVID_Vertex.begin(); i != iend; i++)
{
if ( i->second->ID == s)
i->second->d = 0;
listTempMark.push_back(i->second);
}
Update(s);
while( ! listTempMark.empty() )
{
listTempMark.sort(pVertexComp);
int j = (*listTempMark.begin())->ID;
listTempMark.pop_front();
Update(j);
}
}
跪求各位高手,到底是哪里出了问题啊?急啊