diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-02-06 22:32:25 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-02-06 23:22:01 +0000 |
| commit | f7b8215a6872985df43a03c376550fd16a9188b4 (patch) | |
| tree | d6af0259a8e58d6056602a7196a88d6f743afd3b /src/array_view.hh | |
| parent | bf088a864c07e57f2281966337ecf9dcc5a0b9c0 (diff) | |
Add a from C array constructor to ArrayView
Diffstat (limited to 'src/array_view.hh')
| -rw-r--r-- | src/array_view.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/array_view.hh b/src/array_view.hh index 1c9edf49..14f7e5b4 100644 --- a/src/array_view.hh +++ b/src/array_view.hh @@ -27,6 +27,9 @@ public: ArrayView(const T* begin, const T* end) : m_pointer(begin), m_size(end - begin) {} + template<size_t N> + ArrayView(const T(&array)[N]) : m_pointer(array), m_size(N) {} + template<typename Iterator> ArrayView(const Iterator& begin, const Iterator& end) : m_pointer(&(*begin)), m_size(end - begin) {} |
