我正在用 C++ 实现十五个益智控制台游戏,引发以下错误
Error 4 error C3848: expression having type 'const CompareVPtrs' would lose some const-volatile qualifiers in order to call 'bool CompareVPtrs::operator ()(Vertex *,Vertex *)' c:\program files\microsoft visual studio 11.0\vc\include\xfunctional 324 1 puzzle15
这是我的结构
struct CompareVPtrs: public binary_function<Vertex*, Vertex*, bool>
{
bool operator()( Vertex *lhs, Vertex *rhs)
{
return equal((int *)lhs->state, (int *)lhs->state+16,
(int *)rhs->state);
}
}
CompareVP;