4

I got the following error:

error C3646: 'closure' : unknown override specifier

The code:

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);
}

Do you know why I have this error?

Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
Spectral
  • 717
  • 2
  • 12
  • 28

1 Answers1

9

operator is a keyword. The sequence operator = tries to declare an assignment operator which in your case would have a pointer parameter type. And your compiler wants to parse the very last closure as a special specifier like override (afaik an extension of MSVC), const or such.

Rename the variable to something else, like myoperator.

Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212