From f22ade8ee4705abaa635fa482e97d0b80aa45912 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 23 Apr 2010 09:05:46 -0400 Subject: restrict operator[] to vectors, not matrices. --- test/basicstuff.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/basicstuff.cpp') diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 70b65a7be..efc08655d 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -22,6 +22,8 @@ // License and a copy of the GNU General Public License along with // Eigen. If not, see . +#define EIGEN_NO_STATIC_ASSERT + #include "main.h" template void basicStuff(const MatrixType& m) @@ -96,6 +98,12 @@ template void basicStuff(const MatrixType& m) VERIFY_RAISES_ASSERT(m1 = (m2.block(0,0, rows-1, cols-1))); } + if(cols!=1 && rows!=1) + { + VERIFY_RAISES_ASSERT(m1[0]); + VERIFY_RAISES_ASSERT((m1+m1)[0]); + } + VERIFY_IS_APPROX(m3 = m1,m1); MatrixType m4; VERIFY_IS_APPROX(m4 = m1,m1); -- cgit v1.2.3