[Insight-developers] Compiling with c++0x patch

David Doria daviddoria at gmail.com
Wed Dec 28 20:40:07 EST 2011


If I enable the c++0x flag, I get lots of "error: ‘constexpr’ needed
for in-class initialization of static data member ‘float_sqrteps’ of
non-integral type" errors in vxl/core/vnl/vnl_numeric_traits.h and
vnl_math.h. It seems like float in-class initialization are deprecated by gcc
(the last item here:http://gcc.gnu.org/onlinedocs/gcc/Deprecated-Features.html)

Moving these initialization outside of the class body fixes the errors.

http://review.source.kitware.com/#/c/3583/

It didn't seem to me like the VCL_STATIC_CONST_INIT_FLOAT_DECL macro
was doing anything, and it wouldn't compile with it once I moved the
initializations, but it seems to compile and work fine at least on
gcc.

What is the procedure for pushing this upstream if it seems
reasonable? I really think we should allow code that uses ITK to use
c++0x.

David


More information about the Insight-developers mailing list