New traits

Will Schroeder will.schroeder at kitware.com
Thu May 18 04:57:29 EDT 2000


Hi Folks-

I've checked in some files that reflect the addition of additional traits for the native types (int, float, etc.) as well as itk's itkScalar and itkVector classes. The interesting file is itkNumericTraits that adds traits to the native types by extending (via inheritance) from std::numeric_limits<T> (defined in the include file <limits>). You might want to look at the pre-defined traits in numeric_limits. The documentation in MSVC looks like this (to give you and idea):

template<class T>
     class numeric_limits {
public:
     static const bool has_denorm = false;
     static const bool has_denorm_loss = false;
     static const bool has_infinity = false;
     static const bool has_quiet_NaN = false;
     static const bool has_signaling_NaN = false;
     static const bool is_bounded = false;
     static const bool is_exact = false;
     static const bool is_iec559 = false;
     static const bool is_integer = false;
     static const bool is_modulo = false;
     static const bool is_signed = false;
     static const bool is_specialized = false;
     static const bool tinyness_before = false;
     static const bool traps = false;
     static const float_round_style round_style = round_toward_zero;
     static const int digits = 0;
     static const int digits10 = 0;
     static const int max_exponent = 0;
     static const int max_exponent10 = 0;
     static const int min_exponent = 0;
     static const int min_exponent10 = 0;
     static const int radix = 0;
     static T denorm_min() throw();
     static T epsilon() throw();
     static T infinity() throw();
     static T max() throw();
     static T min() throw();
     static T quiet_NaN() throw();
     static T round_error() throw();
     static T signaling_NaN() throw();
     };

I don't know what half of this stuff means, but it looks like somebody has thought this out and we can take advantage of it in itk.

Can somebody on a Unix box see if they can compile the latest check-ins?

Will
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-developers/attachments/20000518/590cad80/attachment.html>


More information about the Insight-developers mailing list