相关疑难解决方法(0)

具有类型'const CompareVPtrs'的表达式将丢失一些const-volatile限定符以便调用

我在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
Run Code Online (Sandbox Code Playgroud)

这是我的结构

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;
Run Code Online (Sandbox Code Playgroud)

完整的游戏源代码 https://gist.github.com/sunloverz/7338003

c++ stl

8
推荐指数
1
解决办法
6075
查看次数

标签 统计

c++ ×1

stl ×1