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

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

*To*: eigen <eigen@xxxxxxxxxxxxxxxxxxx>*Subject*: [eigen] Bye bye "Eigen/CXX11", welcome "EIGEN_CPPYY_ONLY" ?*From*: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>*Date*: Thu, 19 May 2016 13:00:46 +0100*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=tB5Sr0N1cKiPJP6hrnNYMYUS0DDsE5fh10KeaS2ohFg=; b=Nft6WiGOjm/9HelaQ01eYYoLL1Y3zx2F/r4s+YAjEUQ9HC7fQZ1Euumg6p+Sj07G3w eUP27VRgneBWqOsJfgpm8V9WkiZ97Ng+Z7CQ7hOZCgeEDjQW4Ae9Fxxd+AdRGW+etq7y qNZNfvI7DDmn9MUNCNONZBu4URdvcIYA8Kjtb/RKGJN4vFZW0y56PoQGX64CplsJZImp mjQ6HBSUUzsBfet6sUviD3kcQtMH3FuBFKOVJFtrcw/mB67UBx7LOSpkdlAxknj+Uf+N OXtfsn0w/y8tAGk+Rp+CmKgWsUGWARMlSKXcyOvwXz31jYSe+H4RtkIlV6VO9Nb8Aomf 7c9g==

Hi,

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.

cheers,

gael

**Follow-Ups**:**RE: [eigen] Bye bye "Eigen/CXX11", welcome "EIGEN_CPPYY_ONLY" ?***From:*Daniel.Vollmer

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Convert Eigen::Tensor<double, 2> to Eigen::Matrix<double, -1, -1>** - Next by Date:
**RE: [eigen] Bye bye "Eigen/CXX11", welcome "EIGEN_CPPYY_ONLY" ?** - Previous by thread:
**Re: [eigen] Convert Eigen::Tensor<double, 2> to Eigen::Matrix<double, -1, -1>** - Next by thread:
**RE: [eigen] Bye bye "Eigen/CXX11", welcome "EIGEN_CPPYY_ONLY" ?**

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