diff --git a/src/buffer.hh b/src/buffer.hh index 5f16c0c1..36fc2b0d 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -59,6 +59,9 @@ public: BufferIterator& operator++ (); BufferIterator& operator-- (); + BufferIterator operator++ (int); + BufferIterator operator-- (int); + void clamp(bool avoid_eol); bool is_begin() const; diff --git a/src/buffer_iterator.inl.hh b/src/buffer_iterator.inl.hh index 0f4367ef..0738263a 100644 --- a/src/buffer_iterator.inl.hh +++ b/src/buffer_iterator.inl.hh @@ -199,6 +199,20 @@ inline BufferIterator& BufferIterator::operator--() return *this; } +inline BufferIterator BufferIterator::operator++(int) +{ + BufferIterator save = *this; + ++*this; + return save; +} + +inline BufferIterator BufferIterator::operator--(int) +{ + BufferIterator save = *this; + --*this; + return save; +} + inline bool BufferIterator::is_begin() const { assert(m_buffer);