From f541a639f216b60eb2a80722f3674ae8755db9ff Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 13 Feb 2012 14:14:26 +0000 Subject: [PATCH] support memoryview construction from iterators --- src/memoryview.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/memoryview.hh b/src/memoryview.hh index 30e474e8..9ca0da30 100644 --- a/src/memoryview.hh +++ b/src/memoryview.hh @@ -25,6 +25,10 @@ public: memoryview(const T* begin, const T* end) : m_pointer(begin), m_size(end - begin) {} + template + memoryview(const Iterator& begin, const Iterator& end) + : m_pointer(&(*begin)), m_size(end - begin) {} + memoryview(const std::vector& v) : m_pointer(&v[0]), m_size(v.size()) {}