[Insight-developers] Platform-independent type names and64-bitintegers

Brad King brad.king at kitware.com
Thu Jul 7 10:04:51 EDT 2005


Kris Thielemans wrote:
> I don't know if you use boost already (I think ITK should at least take
> parts of it), but that has it already (and a macro BOOST_NO_INT64_T). See
> http://www.boost.org/libs/integer/cstdint.htm
> Why duplicate?

I'm quite aware of boost and have even made contributions to it in the 
past.  However we have been reluctant to pull any of it into ITK for 
various reasons.  Several ideas have been taken from it and used in ITK 
with proper references, though.

Jim Miller wrote:
 > itk::Type::Int32 is not bad.
 >
 > Doesn't C99 have a nice set of names for these?  Could we use those
 > name in a separate namespace?

Yes, it defines an stdint.h header that is supposed to provide intN_t 
and uintN_t typedefs for all integer types that are available on the 
platform.  The boost/cstdint.hpp header is a wrapper around it for 
cross-platform compatibility.

The VTK implementation of providing these names is much lighter-weight 
than including the whole Boost.Config library.  I suggest we use it to 
put the C99 names into the itk namespace (this was not an option in VTK 
since it doesn't use namespaces).  Then the names would be of the form 
"itk::int8_t", and could be used from inside the itk namespace without 
qualification.

-Brad


More information about the Insight-developers mailing list