Re: [eigen] patches for EIGEN_STATIC_ASSERT

[ Thread Index | Date Index | More Archives ]

Just to toss in a random comment:

On Wed, Dec 17, 2008 at 7:57 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
Thanks for your patches. In principle I like them, buy my GCC 4.3
doesn't seem to (see below)... which shows that these things are
immensely compiler-dependent and that it's going to be difficult to
find a good solution for everyone.

So I make this counter-proposal to you: how about simply turning off
the MSVC warning with a #pragma ?

In order to test the effect of your patches with GCC, I tried this program:

#include <Eigen/Core>
int main() {
 Eigen::Matrix4d m;
 Eigen::Matrix2d n;
 std::cout << (m + n) << std::endl;

First of all I had to add a static assert in CwiseBinaryOp.h to guard
that as somehow we had forgotten to. So, please 'svn up' before if you
want to try.

With the current Eigen, the whole compiler output I get (gcc 4.3) is:

=== BEGIN GCC OUTPUT =================================

cuisine/trunk/kdesupport/eigen2/Eigen/src/Core/CwiseBinaryOp.h: In
constructor 'Eigen::CwiseBinaryOp<BinaryOp, Lhs,
Rhs>::CwiseBinaryOp(const Lhs&, const Rhs&, const BinaryOp&) [with
BinaryOp = Eigen::ei_scalar_sum_op<double>, Lhs =
Eigen::Matrix<double, 4, 4, 0, 4, 4>, Rhs = Eigen::Matrix<double, 2,
2, 0, 2, 2>]':
instantiated from 'const
Eigen::ei_traits<T>::Scalar>, Derived, OtherDerived>
Eigen::MatrixBase<OtherDerived>&) const [with OtherDerived =
Eigen::Matrix<double, 2, 2, 0, 2, 2>, Derived = Eigen::Matrix<double,
4, 4, 0, 4, 4>]'
xdfk.cpp:5:   instantiated from here
error: 'you_mixed_matrices_of_different_sizes' is not a member of

=== END GCC OUTPUT =================================

An aside.

This is great output; it makes working with eigen very nice compared to some other tmp libraries. My only suggestion is to make the errors all caps so that it REALLY_STANDS_OUT_AT_YOU AMONG_THE_COMPILER_OUTPUT.


Mail converted by MHonArc 2.6.19+