From fad1fa75b32ccd3a19fc783a0c660ca512283224 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 6 Jan 2017 13:29:33 +0100 Subject: Propagate compile-time size with "all" and add c++11 array unit test --- test/indexed_view.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/indexed_view.cpp') diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 0be5e434c..5d8ce16ee 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -11,6 +11,10 @@ #include #include "main.h" +#if EIGEN_HAS_CXX11 +#include +#endif + typedef std::pair IndexPair; int encode(Index i, Index j) { @@ -108,6 +112,13 @@ void check_indexed_view() VERIFY( (B(all,1)).ColsAtCompileTime == 1); VERIFY( (B(all,1)).RowsAtCompileTime == 4); + VERIFY( (A(all, eii)).ColsAtCompileTime == eii.SizeAtCompileTime); +#if EIGEN_HAS_CXX11 + VERIFY( (A(all, std::array{{1,3,2,4}})).ColsAtCompileTime == 4); + + VERIFY_IS_APPROX( (A(std::array{{1,3,5}}, std::array{{9,6,3,0}})), A(span(1,3,2), span(9,4,-3)) ); +#endif + } void test_indexed_view() -- cgit v1.2.3