diff --git a/include/array_view.h b/include/array_view.h index 006f18c..e4ffe5d 100644 --- a/include/array_view.h +++ b/include/array_view.h @@ -75,6 +75,7 @@ namespace details class coordinate_facade { static_assert(std::is_integral::value + && !std::is_signed::value && sizeof(ValueType) <= sizeof(size_t), "ValueType must be unsigned integral type!"); static_assert(Rank > 0, "Rank must be greater than 0!"); @@ -1629,6 +1630,10 @@ namespace details template struct array_view_options { + static_assert(std::is_integral::value + && !std::is_signed::value + && sizeof(SizeType) <= sizeof(size_t), "size_type must be unsigned integral type!"); + struct array_view_traits { using value_type = ValueType; diff --git a/tests/array_view_tests.cpp b/tests/array_view_tests.cpp index ba251e8..df25852 100644 --- a/tests/array_view_tests.cpp +++ b/tests/array_view_tests.cpp @@ -1305,7 +1305,7 @@ SUITE(array_view_tests) TEST(custmized_array_view_size) { double (*arr)[3][4] = new double[100][3][4]; - array_view, dynamic_range, 3, 4> av1(arr, (char)10); + array_view, dynamic_range, 3, 4> av1(arr, (char)10); struct EffectiveStructure { @@ -1569,7 +1569,7 @@ SUITE(array_view_tests) CHECK(av1 == av2); - array_view, 20> av3 = av1.as_array_view(dim<>(20)); + array_view, 20> av3 = av1.as_array_view(dim<>(20)); CHECK(av3 == av2 && av3 == av1); }