summaryrefslogtreecommitdiff
path: root/src/array_view.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-05-26 09:25:25 +0100
committerMaxime Coste <mawww@kakoune.org>2017-05-26 09:25:25 +0100
commit57ef592f5784d93d5fee4f2b8b7875bd339b29ca (patch)
treeae64b8976c683e42277ac595e5d09834cad52094 /src/array_view.hh
parent2307cf500cc930f9bcecb8f42e0d87883d9d128f (diff)
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.
Diffstat (limited to 'src/array_view.hh')
-rw-r--r--src/array_view.hh7
1 files 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<size_t N>
constexpr ArrayView(T(&array)[N]) : m_pointer(array), m_size(N) {}
- template<typename Iterator>
- constexpr ArrayView(const Iterator& begin, const Iterator& end)
- : m_pointer(&(*begin)), m_size(end - begin) {}
-
- template<typename Alloc, typename U>
+ template<typename Alloc, typename U,
+ typename = typename std::enable_if<sizeof(U) == sizeof(T)>::type>
constexpr ArrayView(const std::vector<U, Alloc>& v)
: m_pointer(&v[0]), m_size(v.size()) {}