[Insight-developers] GCC4 needing template <>

Brad King brad.king at kitware.com
Fri May 13 09:05:50 EDT 2005


Kent Williams wrote:
> But, in looking through the ITK headers it seems like 'template <>' is 
> used unconditionally.

If there are already places using it unconditionally then we must be 
using only compilers that support it.  I think we can just use it 
directly and not bother with more macros.

> 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.

The classes should either have a virtual destructor added or the virtual 
functions removed.  In the case of itk::Region it looks like the virtual 
destructor should be added.

-Brad


More information about the Insight-developers mailing list