memoryview: add support for reverse iteration
This commit is contained in:
parent
2d42783dbd
commit
aaa6d3ab39
|
@ -44,6 +44,10 @@ public:
|
|||
const T* begin() const { return m_pointer; }
|
||||
const T* end() const { return m_pointer+m_size; }
|
||||
|
||||
using reverse_iterator = std::reverse_iterator<const T*>;
|
||||
reverse_iterator rbegin() const { return reverse_iterator(m_pointer+m_size); }
|
||||
reverse_iterator rend() const { return reverse_iterator(m_pointer); }
|
||||
|
||||
const T& front() const { return *m_pointer; }
|
||||
const T& back() const { return *(m_pointer + m_size - 1); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user