[eigen] Bye bye "Eigen/CXX11", welcome "EIGEN_CPPYY_ONLY" ?

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


we have already discussed about the inclusion of C++11 features two years ago [1], and in short, at that time we decided that:
 - C++11 features for which we have a C++03 fallback could be silently enabled when supported by the compiler (e.g., move ctors)
 - but C++11 features without fallback (e.g., "template typedefs", variadic templates) should be provided through dedicated modules placed in the Eigen/CXX11/ folder.

The rationale was to prevent the introduction of dependences to c++11 features in user code without knowing it.

However, two years later, the status of compilers significantly evolved and it also turns out that exposing some C++11 features this way is really cumbersome. Those include for instance math functions, random generators, template typedefs, etc.

**This is currently one of the main blocker to release 3.3**

I would thus rather propose to:
 - by default, silently enable C++11/14/yy features based on compiler detection
 - add the possibility to explicitly bound the c++ version by defining one the following preprocessor macro: EIGEN_CPP03_ONLY, EIGEN_CPP11_ONLY, EIGEN_CPP14_ONLY, etc.
 - explicitly document the required c++ version for each class/functions (as in the well known online C++ documentations)

This new strategy is more consistent with standard practices (e.g., STL, boost), and the EIGEN_CPPYY_ONLY macro is also consistent with our EIGEN_MPL2_ONLY macro. Let me also add that:
- currently, AFAIK only MSVC enables c++11 features by default, thus limiting the risk when using other compilers
- a user might already unknowingly use C++11 features, for instance from the STL, so I don't see anymore why we should be so strict in Eigen.

Of course, we will still strive to remain compatible with C++03 as much as possible, but there are just some features that cannot be done in c++03 (e.g., template typedef), or that would require incredible efforts (e.g. math functions as gamma, lgamma, zeta, etc.).

I hope this proposal is fine to everybody so that we can move forward with 3.3.

This also means that Eigen/CXX11/Tensor could then be moved to a more standard Eigen/Tensor location.


[1] - http://thread.gmane.org/gmane.comp.lib.eigen/4422

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