From 57ef592f5784d93d5fee4f2b8b7875bd339b29ca Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 26 May 2017 09:25:25 +0100 Subject: [PATCH] Remove unused and potentially error prone constructor from ArrayView Add as well a SFINAE check to the vector constructor to avoid constructing an array_view from derived types with a different size. --- src/array_view.hh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/array_view.hh b/src/array_view.hh index 0c4c9b51..d7dc9fbf 100644 --- a/src/array_view.hh +++ b/src/array_view.hh @@ -31,11 +31,8 @@ public: template constexpr ArrayView(T(&array)[N]) : m_pointer(array), m_size(N) {} - template - constexpr ArrayView(const Iterator& begin, const Iterator& end) - : m_pointer(&(*begin)), m_size(end - begin) {} - - template + template::type> constexpr ArrayView(const std::vector& v) : m_pointer(&v[0]), m_size(v.size()) {}