diff --git a/BAN/include/BAN/LinkedList.h b/BAN/include/BAN/LinkedList.h index 8c6cb71f..2098d707 100644 --- a/BAN/include/BAN/LinkedList.h +++ b/BAN/include/BAN/LinkedList.h @@ -38,7 +38,7 @@ namespace BAN ErrorOr emplace(iterator, Args&&...); void pop_back(); - void remove(iterator); + iterator remove(iterator); void clear(); iterator begin() { return iterator(m_data, empty()); } @@ -201,7 +201,7 @@ namespace BAN } template - void LinkedList::remove(iterator iter) + LinkedList::iterator LinkedList::remove(iterator iter) { ASSERT(!empty() && iter); Node* node = iter.m_current; @@ -212,6 +212,7 @@ namespace BAN (prev ? prev->next : m_data) = next; (next ? next->prev : m_last) = prev; m_size--; + return next ? iterator(next, false) : iterator(m_last, true); } template