From befcac883de5ba98ca2322c87e56f278c140588d Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Tue, 9 Oct 2018 15:36:01 -0700 Subject: Hide stl-container detection test under #if --- test/stl_iterators.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/stl_iterators.cpp') diff --git a/test/stl_iterators.cpp b/test/stl_iterators.cpp index 75e23b2fb..d8e6e8106 100644 --- a/test/stl_iterators.cpp +++ b/test/stl_iterators.cpp @@ -378,12 +378,10 @@ bool IsContainerType(int /* dummy */) { return true; } template bool IsContainerType(long /* dummy */) { return false; } -#endif // EIGEN_HAS_CXX11 template void test_stl_container_detection(int rows=Rows, int cols=Cols) { -#if EIGEN_HAS_CXX11 typedef Matrix VectorType; typedef Matrix ColMatrixType; typedef Matrix RowMatrixType; @@ -391,7 +389,7 @@ void test_stl_container_detection(int rows=Rows, int cols=Cols) ColMatrixType A = ColMatrixType::Random(rows, cols); RowMatrixType B = RowMatrixType::Random(rows, cols); - Index i; + Index i = 1; using ColMatrixColType = decltype(A.col(i)); using ColMatrixRowType = decltype(A.row(i)); @@ -408,8 +406,8 @@ void test_stl_container_detection(int rows=Rows, int cols=Cols) // But the matrix itself is not a valid Stl-style container. VERIFY_IS_EQUAL(IsContainerType(0), rows == 1 || cols == 1); VERIFY_IS_EQUAL(IsContainerType(0), rows == 1 || cols == 1); -#endif } +#endif EIGEN_DECLARE_TEST(stl_iterators) { @@ -419,7 +417,9 @@ EIGEN_DECLARE_TEST(stl_iterators) CALL_SUBTEST_1(( test_stl_iterators(internal::random(5,10), internal::random(5,10)) )); CALL_SUBTEST_1(( test_stl_iterators(internal::random(10,200), internal::random(10,200)) )); } - + +#if EIGEN_HAS_CXX11 CALL_SUBTEST_1(( test_stl_container_detection() )); CALL_SUBTEST_1(( test_stl_container_detection() )); +#endif } -- cgit v1.2.3