expression having type 'const CompareVPtrs' would lose some const-volatile qualifiers in order to call
It means your comparison operator needs to be const
:
bool operator()( Vertex *lhs, Vertex *rhs) const
{ // ^^^^^
....
}