I implement the fifteenth puzzle in C ++, it raises the following error
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
This is my structure
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;
The full source code of the game is https://gist.github.com/sunloverz/7338003
source share