[vtk-developers] Proposing vtkObjectMacro

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Sep 13 11:07:17 EDT 2012


> I am in favor of adding the macro, and disagree with Utkarsh in that
> we already have the type macro etc and it will remove the need for a
> lot of boiler plate code in each class declaration.

Note  that vtkTypeMacro() doesn't force you to add anything in the cxx
file. You can pretty much not know what that macro does and you're
okay. Not so with this macro. Also hiding constructor/destructor is
really weird to me. Why would you? I don't think I am thrilled by
having to implement function definitions without seeing their
declarations in the header. None of the existing macros do that, not
even in Qt, as far as I know. Readability of code is far more
important that saving typing a few more lines, IMHO.

Utkarsh



More information about the vtk-developers mailing list