diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-01 23:32:55 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-01 23:32:55 +0100 |
| commit | 8062afc25e895cb49e76f6e26e51a7d4a1ad2df2 (patch) | |
| tree | f64e6522a84a8f58912b9e58a66c187fbcaadd78 /lib/nes/common | |
| parent | bf88e17d552d85cd18bc31757ef9d73049b327c4 (diff) | |
revamp input system
Diffstat (limited to 'lib/nes/common')
| -rw-r--r-- | lib/nes/common/list.hh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/nes/common/list.hh b/lib/nes/common/list.hh index d7a7d9b..b1fddf0 100644 --- a/lib/nes/common/list.hh +++ b/lib/nes/common/list.hh @@ -106,10 +106,10 @@ namespace nes } /// Remove an item from the list. - auto remove(T& item) -> void + auto remove(T& item) -> bool { node& item_node = item; - if (!item_node.list_) { return; } + if (!item_node.list_) { return false; } if (head_ == &item) { head_ = item_node.next_; } if (tail_ == &item) { tail_ = item_node.prev_; } @@ -119,12 +119,15 @@ namespace nes item_node.next_ = nullptr; item_node.prev_ = nullptr; item_node.list_ = nullptr; + + return true; } /// Remove an item from the list by its iterator. - auto remove(iterator it) -> void + auto remove(iterator it) -> bool { - if (it != end()) { remove(**it); } + if (it != end()) { return remove(**it); } + return false; } }; } // namespace nes
\ No newline at end of file |
