错误C3646:'closure':未知的覆盖说明符

时间:2010-12-13 08:22:31

标签: c++ override specifier

我收到以下错误:

error C3646: 'closure' : unknown override specifier

代码:

void BaseOperator::mousebutton_cb(EventObject* sender, EventArgs* calldata, void* closure)
{
    xd3D::Operation::Operator::BaseOperator* operator = (xd3D::Operation::Operator::BaseOperator*)closure;
    MouseButtonEventArgs* e = (MouseButtonEventArgs*)calldata;
    if (e->Status == Down)
        operator->OnMouseButtonDown(e);
    else
        operator->OnMouseButtonUp(e);
}

你知道为什么我有这个错误吗?

1 个答案:

答案 0 :(得分:9)

operator是一个关键字。序列operator =尝试声明一个赋值运算符,在您的情况下,它将具有指针参数类型。并且您的编译器希望将最后closure解析为特殊说明符,如override(afaik是MSVC的扩展名),const等。

将变量重命名为其他内容,例如myoperator