[vtk-developers] Sized types: vtkInt32Type et al

Brad King brad.king at kitware.com
Mon May 30 16:54:23 EDT 2005


David Gobbi wrote:
> I see that in vtkTemplateAliasMacro you kept the ability to turn 
> individual types on or off, just like in my original code.
> The nested macros are an interesting way to do this... I'd have to say 
> that my original, verbose formulation was a bit easier to
> read.  I guess that fewer lines of code means less chance of a typo 
> creeping in, though.

There is more motivation for the nested macros than just the brevity of 
the code.  This implementation actually allows individual uses to turn 
on/off the set of types used:

#include "vtkTemplateAliasMacro.h"
...
vtkTemplateAliasMacro(...) // With INT64
#undef VTK_USE_INT64
#define VTK_USE_INT64 0
vtkTemplateAliasMacro(...) // Without INT64

It works because the values of these on/off macros are not tested until 
the macro is invoked.

-Brad



More information about the vtk-developers mailing list