aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/stl_iterators.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-11-09 21:45:10 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-11-09 21:45:10 +0100
commit784a3f13cfbb58d51f8c8d49a8c2c424e27ad013 (patch)
treea65fa8a87273033a39320479b1770a4052924a8c /test/stl_iterators.cpp
parentdb9a9a12ba25353c94417dba24fab35cee16bde1 (diff)
bug #1619: fix mixing of const and non-const generic iterators
Diffstat (limited to 'test/stl_iterators.cpp')
-rw-r--r--test/stl_iterators.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/stl_iterators.cpp b/test/stl_iterators.cpp
index 8c56db506..5fef34c0d 100644
--- a/test/stl_iterators.cpp
+++ b/test/stl_iterators.cpp
@@ -66,9 +66,15 @@ void check_begin_end_for_loop(Xpr xpr)
{
// simple API check
- typename Xpr::const_iterator cit;
- cit = xpr.begin();
+ typename Xpr::const_iterator cit = xpr.begin();
cit = xpr.cbegin();
+
+ #if EIGEN_HAS_CXX11
+ auto tmp1 = xpr.begin();
+ VERIFY(tmp1==xpr.begin());
+ auto tmp2 = xpr.cbegin();
+ VERIFY(tmp2==xpr.cbegin());
+ #endif
}
VERIFY( xpr.end() -xpr.begin() == xpr.size() );
@@ -150,8 +156,9 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
{
check_begin_end_for_loop(v);
- check_begin_end_for_loop(v.col(internal::random<Index>(0,A.cols()-1)));
- check_begin_end_for_loop(v.row(internal::random<Index>(0,A.rows()-1)));
+ check_begin_end_for_loop(A.col(internal::random<Index>(0,A.cols()-1)));
+ check_begin_end_for_loop(A.row(internal::random<Index>(0,A.rows()-1)));
+ check_begin_end_for_loop(v+v);
}
#if EIGEN_HAS_CXX11