Re: [eigen] Taking advantage of C++11 features in Eigen

[ Thread Index | Date Index | More Archives ]

On 11.02.2014 20:54, Nicola Gigante wrote:
I’m recently starting to follow the Eigen project and I was wondering which is the current status
of C++11 features support inside the library. It seems the library is “compatible” with C++11,
meaning that it compiles and works properly with the new standard, but does not take
advantage of new features when available.

Generally, we want to keep Eigen C++03 compatible as much as possible. There are C++11 things implemented which don't jeopardize that, like move semantics.

Things like initializer lists might encourage people to rely on that and causing trouble when back-porting to C++03. We might allow things like that if the user explicitly includes something like <Eigen/CXX11/Core> -- we already had a similar discussion about that for the tensor module:
** Addendum after reading the link from Jitse's mail: It appears initializer lists have much less power than our current CommaInitializer

I think most other features you suggested are at the moment a bit risky having still a lot of compilers around without or with incomplete C++11 support. IMHO we could consider using features if they give (measurable) performance improvements, but for now I wouldn't do it "just" for cleaner code or minor compile time reductions. We'd have to guard it with #ifdefs anyhow to keep C++03 compatibility, essentially making the code less clean.

I hope I did not entirely block you from contributing to Eigen. In the long run we definitely want more C++11 features in Eigen, but for now we should not risk C++03 compatibility.


Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252

Mail converted by MHonArc 2.6.19+