MouseEvent is passively copyable?

the MouseEvent class has the assignment operator marked as private. However, the copy constructor isn’t explicitly defined, and is implicitly defined by the compiler:


Is this intentional?

I can copy mouse events for use in lambdas like this:

    auto callback = [e2 = MouseEvent(e)](Listener& listener)

is this a bug in the MouseEvent class? not following the rule of 3…

The assignment operator is deleted just to stop old compilers moaning, since it has const members and hence isn’t assignable. But copying it is fine, that’s all as intended. Normally it’d be good practice to add a copy operator which is marked “= default” to make it clear that it exists, but I think we still have to avoid that because it doesn’t work in some versions of MSVC

AFAIK, that was Visual Studio 2013, which was dropped in JUCE 5.4.4.

The assignment operator is not deleted, it’s just declared as private and never implemented. Or at least I couldn’t find the implementation. :thinking::thinking::thinking:

Right. Same thing.