add postfix operator++ to BufferIterator

This commit is contained in:
Maxime Coste 2012-10-02 14:09:06 +02:00
parent 9ec10daf69
commit 669d2e456f
2 changed files with 17 additions and 0 deletions

View File

@ -59,6 +59,9 @@ public:
BufferIterator& operator++ (); BufferIterator& operator++ ();
BufferIterator& operator-- (); BufferIterator& operator-- ();
BufferIterator operator++ (int);
BufferIterator operator-- (int);
void clamp(bool avoid_eol); void clamp(bool avoid_eol);
bool is_begin() const; bool is_begin() const;

View File

@ -199,6 +199,20 @@ inline BufferIterator& BufferIterator::operator--()
return *this; 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 inline bool BufferIterator::is_begin() const
{ {
assert(m_buffer); assert(m_buffer);