iterator/referencing: change relation operators to be const

This commit is contained in:
Danny Robson 2019-05-17 10:49:40 +10:00
parent a4d963e00b
commit 37f5d77622

View File

@ -37,12 +37,12 @@ namespace cruft::iterator {
referencing_iterator& operator++() { ++m_base; return *this; }
referencing_iterator operator++(int) { auto val = *this; ++m_base; return val; }
bool operator== (const referencing_iterator<Base> &rhs) { return m_base == rhs.m_base; }
bool operator!= (const referencing_iterator<Base> &rhs) { return m_base != rhs.m_base; }
bool operator>= (const referencing_iterator<Base> &rhs) { return m_base >= rhs.m_base; }
bool operator<= (const referencing_iterator<Base> &rhs) { return m_base <= rhs.m_base; }
bool operator> (const referencing_iterator<Base> &rhs) { return m_base > rhs.m_base; }
bool operator< (const referencing_iterator<Base> &rhs) { return m_base < rhs.m_base; }
bool operator== (const referencing_iterator<Base> &rhs) const { return m_base == rhs.m_base; }
bool operator!= (const referencing_iterator<Base> &rhs) const { return m_base != rhs.m_base; }
bool operator>= (const referencing_iterator<Base> &rhs) const { return m_base >= rhs.m_base; }
bool operator<= (const referencing_iterator<Base> &rhs) const { return m_base <= rhs.m_base; }
bool operator> (const referencing_iterator<Base> &rhs) const { return m_base > rhs.m_base; }
bool operator< (const referencing_iterator<Base> &rhs) const { return m_base < rhs.m_base; }
const value_type& operator*() const
{ return **m_base; }