support memoryview construction from iterators
This commit is contained in:
parent
9304e41326
commit
f541a639f2
|
@ -25,6 +25,10 @@ public:
|
||||||
memoryview(const T* begin, const T* end)
|
memoryview(const T* begin, const T* end)
|
||||||
: m_pointer(begin), m_size(end - begin) {}
|
: m_pointer(begin), m_size(end - begin) {}
|
||||||
|
|
||||||
|
template<typename Iterator>
|
||||||
|
memoryview(const Iterator& begin, const Iterator& end)
|
||||||
|
: m_pointer(&(*begin)), m_size(end - begin) {}
|
||||||
|
|
||||||
memoryview(const std::vector<T>& v)
|
memoryview(const std::vector<T>& v)
|
||||||
: m_pointer(&v[0]), m_size(v.size()) {}
|
: m_pointer(&v[0]), m_size(v.size()) {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user