[Insight-users] NumericTraits and VariableLengthVector

Emmanuel Christophe emmanuel.christophe at gmail.com
Thu Oct 30 04:42:52 EDT 2008


Hi,
I'm having some trouble using the NumericTraits with the VariableLengthVector.

The following code:

#include "itkVariableLengthVector.h"
int main(int argc, char** argv)
{
  typedef itk::VariableLengthVector<double> RealType;
  RealType myVariable = itk::NumericTraits<RealType>::Zero;
}

don't compile with gcc 4.3:
error: invalid conversion from 'const
itk::VariableLengthVector<double> (*)(const
itk::VariableLengthVector<double>&)' to 'unsigned int'

I'm probably using the NumericTraits in the wrong way, but I can't
think of another one... Even when I try to initialize the size of
myVariable, I get the same problem.


The next code compile, but surprisingly display 1:

#include "itkVariableLengthVector.h"
int main(int argc, char** argv)
{
  typedef itk::VariableLengthVector<double> RealType;
  std::cout << itk::NumericTraits<RealType>::Zero << std::endl;
}


Any suggestion?
Emmanuel


More information about the Insight-users mailing list