mirror of
https://github.com/AxioDL/nod.git
synced 2025-07-04 12:15:56 +00:00
DiscBase: Mark member functions as const where applicable
These don't modify instance state, so they can be marked as const.
This commit is contained in:
parent
998d6a77c3
commit
f443b60bde
@ -207,8 +207,8 @@ public:
|
|||||||
using pointer = Node*;
|
using pointer = Node*;
|
||||||
using reference = Node&;
|
using reference = Node&;
|
||||||
|
|
||||||
bool operator!=(const DirectoryIterator& other) { return m_it != other.m_it; }
|
bool operator==(const DirectoryIterator& other) const { return m_it == other.m_it; }
|
||||||
bool operator==(const DirectoryIterator& other) { return m_it == other.m_it; }
|
bool operator!=(const DirectoryIterator& other) const { return !operator==(other); }
|
||||||
DirectoryIterator& operator++() {
|
DirectoryIterator& operator++() {
|
||||||
if (m_it->m_kind == Kind::Directory)
|
if (m_it->m_kind == Kind::Directory)
|
||||||
m_it = m_it->rawEnd();
|
m_it = m_it->rawEnd();
|
||||||
@ -217,7 +217,9 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
Node& operator*() { return *m_it; }
|
Node& operator*() { return *m_it; }
|
||||||
|
const Node& operator*() const { return *m_it; }
|
||||||
Node* operator->() { return &*m_it; }
|
Node* operator->() { return &*m_it; }
|
||||||
|
const Node* operator->() const { return &*m_it; }
|
||||||
};
|
};
|
||||||
DirectoryIterator begin() const { return DirectoryIterator(m_childrenBegin); }
|
DirectoryIterator begin() const { return DirectoryIterator(m_childrenBegin); }
|
||||||
DirectoryIterator end() const { return DirectoryIterator(m_childrenEnd); }
|
DirectoryIterator end() const { return DirectoryIterator(m_childrenEnd); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user