assignment operators in vtk

Hello,

I was just wondering, because I don’t understand it.
Is it ok for all deleted assignment operators in vtk classes to be written like this ?

void operator=(const T&) = delete;

Shouldn’t they be written this way to overload operator= ?

T& operator=(const T&) = delete;

is it ok for the objects to be movable by default ?

VTK doesn’t really “do” moves, but it probably isn’t safe (e.g., things the ctor constructs may not be reconstructible via methods to “restore” such a member to a valid state). I forget the rules of move operators and ctors…they might not be made at all given the set of other magic methods in VTK classes.

As for the operators, the return type can’t be overloaded, so it doesn’t really matter what it returns. There are a number of (suppressed) clang-tidy warnings around these methods anyways:

  • the return type as you suggest
  • that they are private (users first get the error that they are inaccessible, not that they are explicitly deleted)

Thanks for your answers. I didn’t know that the return type doesn’t matter in the overload of a function declaration.