Re: [eigen] Initial implementation of tensor support |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: Eigen development <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Initial implementation of tensor support
- From: Rhys Ulerich <rhys.ulerich@xxxxxxxxx>
- Date: Wed, 30 Oct 2013 14:39:53 -0500
- Cc: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=UoVEQSqAU3Wx8S44K7DZmgsHeE3exQSemMijEA1RTQ8=; b=kvUAimssREDVlKvfY3q96dgIh5+ICQUP9Pd5jmtY4KH5wBhb73xqCeNhy85fwTEaeX E7ZU3XWyAUPfBAbu3qjaAgvN/pRURWhtXL+9TGOet273GFPnsPsVFO+xI/gyGN3teyVQ iEu5IV/Qs/4KiyoySD9joQVnUxLZ8QHYz6W9UL/Ykbjz+zK7fOmBM9D1jg2d1b4+PQA6 EZ9tznDm+7PnmOQp+0SkG5okMVjONDBNZOge5RACM897fmeG7r91gzN9luOe1m4Yh7y5 G2T38whP64q9fCcDUtwye8HYu/3Gvxygyg7YIngqHaIkBUvx/fCi3aaOoPS71ohcQ0Se yKyA==
> 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