Re: [eigen] Initial implementation of tensor support

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


> Actually, this is one of the reasons I suggested using a #define to
> enable Eigen's C++11 features.  If one must manually define
> EIGEN_ENABLE_CXX11, it will remove the risk that a project begins using
> C++11 features without realizing it.
>
> Another issue is that some compiler versions claim to support C++11
> through their __cplusplus macro, but do not support all C++11 features.
>  I'm sure you can find ways to deal with this, but it is something to
> consider.

I do like this notion as often compilers support a good chunk of C++11
but don't advertise it in __cplusplus.  So, maybe,
  #if __cplusplus >= 201103L || defined(EIGEN_ENABLE_CXX11)
  # ifndef EIGEN_ENABLE_CXX11
  #   define EIGEN_ENABLE_CXX11
  # endif
  #endif
whereafter guards in Eigen or application code use #ifdef
EIGEN_ENABLE_CXX11 for features requiring the newer language.

That lets (a) C++11 stuff just work under new-enough compilers and (b)
folks with older compiler who swear they're okay can #define
EIGEN_ENABLE_CXX11 themselves at their own risk.

- Rhys



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/