[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
On Wed, Oct 30, 2013 at 1:20 PM, Keir Mierle <mierle@xxxxxxxxx> wrote:
> From the peanut gallery, I'd like to throw in that personally, as much as
> I would love to use C++11, it isn't a realistic choice for many projects.
> Especially in the embedded world, or on Windows for people stuck on older
> versions of MSVC. I think if Eigen goes in a direction where C++11 is
> required or important functionality is only accessible with C++11 will
> result in a balkanized Eigen community, with many people stuck on older
> versions (since they can't upgrade). For example, Blender on Windows needs
> to compile with MSVC 2010 (IIRC) and so requiring C++11 would immediately
> freeze Eigen on Blender.
>
> And, since Eigen is such a low level library, there is significant risk
> that you could put projects in an impossible situation; e.g. if Ceres were
> to switch to using C++11-required Eigen features, then suddenly Ceres would
> also be frozen in Blender (since Blender relies on Ceres). Due to Eigen's
> popularity in numeric libraries, this issue is magnified.
>
>
> On Wed, Oct 30, 2013 at 8:39 PM, Rhys Ulerich <rhys.ulerich@xxxxxxxxx>wrote:
>
>> > 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
>>
>>
>>
>
--047d7bd770a468e5ea04e9fb28fb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">From the peanut gallery as well, I'll mention that div=
orcing the concept of 'this compiler supports C++11' from 'we w=
ant to use C++11 features' via a=A0EIGEN_ENABLE_CXX11-type define is de=
finitely a welcome feature for us.</div>
<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Wed, Oct 3=
0, 2013 at 1:20 PM, Keir Mierle <span dir=3D"ltr"><<a href=3D"mailto:mie=
rle@xxxxxxxxx" target=3D"_blank">mierle@xxxxxxxxx</a>></span> wrote:<br>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div dir=3D"ltr">From the peanut gallery, I'd like to throw in that per=
sonally, as much as I would love to use C++11, it isn't a realistic cho=
ice for many projects. Especially in the embedded world, or on Windows for =
people stuck on older versions of MSVC. I think if Eigen goes in a directio=
n where C++11 is required or important functionality is only accessible wit=
h C++11 will result in a balkanized Eigen community, with many people stuck=
on older versions (since they can't upgrade). For example, Blender on =
Windows needs to compile with MSVC 2010 (IIRC) and so requiring C++11 would=
immediately freeze Eigen on Blender.<div>
<br></div><div>And, since Eigen is such a low level library, there is signi=
ficant risk that you could put projects in an impossible situation; e.g. if=
Ceres were to switch to using C++11-required Eigen features, then suddenly=
Ceres would also be frozen in Blender (since Blender relies on Ceres). Due=
to Eigen's popularity in numeric libraries, this issue is magnified.</=
div>
</div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"><b=
r><br><div class=3D"gmail_quote">On Wed, Oct 30, 2013 at 8:39 PM, Rhys Uler=
ich <span dir=3D"ltr"><<a href=3D"mailto:rhys.ulerich@xxxxxxxxx" target=
=3D"_blank">rhys.ulerich@xxxxxxxxx</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>> Actually, this is one of the reaso=
ns I suggested using a #define to<br>
> enable Eigen's C++11 features. =A0If one must manually define<br>
> EIGEN_ENABLE_CXX11, it will remove the risk that a project begins usin=
g<br>
> C++11 features without realizing it.<br>
><br>
> Another issue is that some compiler versions claim to support C++11<br=
>
> through their __cplusplus macro, but do not support all C++11 features=
..<br>
> =A0I'm sure you can find ways to deal with this, but it is somethi=
ng to<br>
> consider.<br>
<br>
</div>I do like this notion as often compilers support a good chunk of C++1=
1<br>
but don't advertise it in __cplusplus. =A0So, maybe,<br>
=A0 #if __cplusplus >=3D 201103L || defined(EIGEN_ENABLE_CXX11)<br>
=A0 # ifndef EIGEN_ENABLE_CXX11<br>
=A0 # =A0 define EIGEN_ENABLE_CXX11<br>
=A0 # endif<br>
=A0 #endif<br>
whereafter guards in Eigen or application code use #ifdef<br>
EIGEN_ENABLE_CXX11 for features requiring the newer language.<br>
<br>
That lets (a) C++11 stuff just work under new-enough compilers and (b)<br>
folks with older compiler who swear they're okay can #define<br>
EIGEN_ENABLE_CXX11 themselves at their own risk.<br>
<span><font color=3D"#888888"><br>
- Rhys<br>
<br>
<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
--047d7bd770a468e5ea04e9fb28fb--