[Insight-developers] GCC4 needing template <>

Kent Williams norman-k-williams at uiowa.edu
Thu May 12 12:40:21 EDT 2005


Gcc4 it requires 'template <>' before the explicit specialization of 
templated functions. This came up in discussions a couple weeks ago when 
I started looking at GCC4, and someone suggested that this not be used 
universally, but added in (via #ifdefs) on platforms/compilers that 
required it.

But, in looking through the ITK headers it seems like 'template <>' is 
used unconditionally. So I'm guessing it needs to be added to the macros 
in itkMetaDataObject.h like NATIVE_TYPE_METADATAPRINT. Or should maybe 
those macros go away? The only place they actually get used as near as I 
can tell is in one program -- one of ours, not part of ITK -- where they 
probably aren't necessary.

The other new complaint of GCC4 -- at least with the compiler flags we 
use -- is 'warning: ‘class itk::Region’ has virtual functions but 
non-virtual destructor' -- which is actually triggered by several ITK 
classes. Should those classes define a virtual destructor? In the case 
of itk::Region there is no destructor, because it's a virtual base 
class, from which itk::ImageRegion and itk::MeshRegion derive.



More information about the Insight-developers mailing list