[Insight-developers] ZeroIndex

Bill Hoffman bill . hoffman at kitware . com
Tue, 27 Aug 2002 10:07:17 -0400


OK, there is only one static left that is breaking the compile on the Mac.

template<unsigned int VIndexDimension=2>
class Index {
public:
  static const Self ZeroIndex;
...


// Set the const definition of the ZeroIndex. This uses the aggregate
// initialization shortcut to assign all the data in the aggregate to zero.
template<unsigned int VIndexDimension>
const Index<VIndexDimension>
Index<VIndexDimension>
::ZeroIndex = {{0}};


However, this one seems a bit harder to remove than the rest of them.
Any ideas?

To get around the problem, you can add explicit instantiations for Index.

template class itk::Index<2>; 
template class itk::Index<3>; 
template class itk::Index<4>; 
template class itk::Index<5>; 

This gets around the problem on the Mac, but if you ever template over a different
number, it will not work.

-Bill