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

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


On 12.02.2014 13:18, Helmut Jarausch wrote:
Gnu's standard library is full of code like

#if defined(__cplusplus) && __cplusplus >= 201103L

I would not consider GCCs standard library as a good example of clean code ;) Partially, that is because they must implement C++11 library functions but still need to be compatible with C++03 (unless they wanted to provide separate headers for that).

and AFAIR  the preprocessor symbol cplusplus is standardized.

Yes it is, but I still think we should abstract from that. Some compilers with experimental C++11 support do not already define __cplusplus to be 201103L, but we might still want to allow certain features (e.g. we allow move semantics if __GXX_EXPERIMENTAL_CXX0X__ is defined). This also allows people experimenting with Eigen more easily to enable or disable certain features.

Christoph


--
----------------------------------------------
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+ http://listengine.tuxfamily.org/