Make BufferIterator only a bidirectional iterator

Distance computation is too expensive on BufferIterators to
treat them as random access.
This commit is contained in:
Maxime Coste 2017-01-28 13:06:03 +00:00
parent 072064407a
commit 68b92b9ac1

View File

@ -55,7 +55,9 @@ public:
using difference_type = ssize_t;
using pointer = const value_type*;
using reference = const value_type&;
using iterator_category = std::random_access_iterator_tag;
// computing the distance between two iterator can be
// costly, so this is not strictly random access
using iterator_category = std::bidirectional_iterator_tag;
BufferIterator() : m_buffer(nullptr) {}
BufferIterator(const Buffer& buffer, BufferCoord coord);