diff options
author | Benji Dial <benji@benjidial.net> | 2024-07-29 19:59:52 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-07-29 19:59:52 -0400 |
commit | e6c3a80b01ffb52079783cddd9be6d392d0f7039 (patch) | |
tree | 148276b9878f287bc81638f90249ec4d7b86eaf0 /euler/include/std/list.hpp | |
parent | be691582ee12613278af24cb5a824eeb357f6324 (diff) | |
download | hilbert-os-e6c3a80b01ffb52079783cddd9be6d392d0f7039.tar.gz |
redesign compositor protocol, start widget library
Diffstat (limited to 'euler/include/std/list.hpp')
-rw-r--r-- | euler/include/std/list.hpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/euler/include/std/list.hpp b/euler/include/std/list.hpp index 77eaaec..c0d6e21 100644 --- a/euler/include/std/list.hpp +++ b/euler/include/std/list.hpp @@ -19,11 +19,11 @@ namespace std { node *the_node; - bool operator ==(const generic_iterator &other) { + bool operator ==(const generic_iterator &other) const { return the_node == other.the_node; } - bool operator !=(const generic_iterator &other) { + bool operator !=(const generic_iterator &other) const { return the_node != other.the_node; } @@ -82,13 +82,14 @@ namespace std { return iterator { .the_node = r }; } - iterator begin() const noexcept { - return iterator { .the_node = first_node }; - } + iterator begin() noexcept { return iterator { .the_node = first_node }; } + iterator end() noexcept { return iterator { .the_node = 0 }; } - iterator end() const noexcept { - return iterator { .the_node = 0 }; - } + const_iterator begin() const noexcept { return iterator { .the_node = first_node }; } + const_iterator end() const noexcept { return iterator { .the_node = 0 }; } + + const_iterator cbegin() const noexcept { return iterator { .the_node = first_node }; } + const_iterator cend() const noexcept { return iterator { .the_node = 0 }; } size_t remove(const T &value) { size_t removed = 0; @@ -140,6 +141,7 @@ namespace std { clear(); for (node *n = other.first_node; n; n = n->next) push_back(n->value); + return *this; } list &operator =(list &&other) { @@ -150,6 +152,7 @@ namespace std { other.first_node = 0; other.last_node = 0; other.count = 0; + return *this; } }; |