[Insight-developers] Explicit Template Instantiation & NumericTraits specializations

Luis Ibanez luis.ibanez at kitware.com
Sat May 10 19:09:32 EDT 2008



Hi Julien,

Could you help us figure out what is the problem with
http://www.cdash.org/CDash/viewBuildError.php?buildid=72394
??


I recently added NumericTraits for the FixedArray, but
have not been able to figure out where they should be
included in order to work correctly with the explicit
instantiation.


Following the pattern of the itkVector.h has not been
a successful method.


NumericTraits of specific classes are included under
different sets of conditions, and they don't seem to
be consistent.




For example:

A) in itk::Vector

itkVector.h

#if ITK_TEMPLATE_EXPLICIT
# include "Templates/itkVector+-.h"
#endif

#if ITK_TEMPLATE_TXX
# include "itkVector.txx"
#endif

#if ITK_TEMPLATE_EXPLICIT
   #include "itkNumericTraitsVectorPixel.h"
#endif

itkVector.txx

#include "itkNumericTraitsVectorPixel.h"
(without conditionals)



B) in itk::CovariantVector


itkCovariantVector.h

#if ITK_TEMPLATE_EXPLICIT
# include "Templates/itkCovariantVector+-.h"
#endif

#if ITK_TEMPLATE_TXX
#include "itkNumericTraitsCovariantVectorPixel.h"
# include "itkCovariantVector.txx"
#endif

(no traits)


itkCovariantVector.txx

(only the generic NumericTraits are included)


C) in itk::RGBPixel


itkRGBPixel.h


#if ITK_TEMPLATE_EXPLICIT
# include "Templates/itkRGBPixel+-.h"
#endif

#if ITK_TEMPLATE_TXX
# include "itkRGBPixel.txx"
#endif

#ifndef ITKCommon_EXPORTS
   #include "itkNumericTraitsRGBPixel.h"
#endif

(note ITKCommon_EXPORTS ??)


itkRGBPixel.txx

#include "itkNumericTraits.h"

(no RGBPixel specific traits).



D) itk::VariableLengthVector

itkVariableLengthVector.h


#if ITK_TEMPLATE_EXPLICIT
# include "Templates/itkVariableLengthVector+-.h"
#endif

#if ITK_TEMPLATE_TXX
# include "itkVariableLengthVector.txx"
#endif

(no VariableLengthVector specific traits )

itkVariableLengthVector.txx

#include "itkNumericTraitsVariableLengthVectorPixel.h"



....


so... from looking at this other classes
I have not been able to stablish a pattern.


What should be the right pattern to follow ?


Shouldn't all these classes above use the same approach ?


   Thanks for any hint,


       Luis



More information about the Insight-developers mailing list