add Cursor::address()

This commit is contained in:
Josh Holtrop 2016-11-07 22:15:29 -05:00
parent 940165a78f
commit b532e80ac8

View File

@ -41,8 +41,8 @@ public:
return 0xFFFFFFFFu;
}
}
GapBuffer * gap_buffer() { return m_gap_buffer; }
bool operator<(const Iterator & other)
GapBuffer * gap_buffer() const { return m_gap_buffer; }
bool operator<(const Iterator & other) const
{
return m_offset < other.m_offset;
}
@ -69,11 +69,12 @@ public:
bool go_right(bool allow_eol);
bool go_up(size_t target_column);
bool go_down(size_t target_column);
bool operator<(const Cursor & other)
bool operator<(const Cursor & other) const
{
return m_iterator < other.m_iterator;
}
uint32_t operator*() { return *m_iterator; }
uint32_t operator*() const { return *m_iterator; }
uint8_t * address() const { return m_iterator.address(); }
protected:
Iterator m_iterator;