[Insight-developers] Platform-independent typenames and64-bitintegers

Miller, James V (Research) millerjv at crd.ge.com
Thu Jul 7 12:30:55 EDT 2005


I like the idea of taking whatever names we expect C++ to eventually
adopt (C99's, boost's, whatever) and defining the types in an itk
namespace. 

If we use itk::int8_t as just int8_t when inside the itk namespace, 
will we have any problems when C++ adopts (or compilers provide) an
int8_t?  Or do we just drop our inclusion into the itk namespace 
for those platforms at that time?

Jim





-----Original Message-----
From: insight-developers-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-developers-bounces+millerjv=crd.ge.com at itk.org]On Behalf
Of Brad King
Sent: Thursday, July 07, 2005 10:05 AM
To: Miller, James V (Research)
Cc: 'Insight Developers'
Subject: Re: [Insight-developers] Platform-independent typenames
and64-bitintegers


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
_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list