AK: Fix erroneous move operators for SinglyLinkedList
This patch provides a proper implementation of the move operator and delete the move assignment operator. Those operators were introduced in #11888
This commit is contained in:
parent
589ebbc24e
commit
b0d51a6f36
Notes:
sideshowbarker
2024-07-17 20:39:44 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/b0d51a6f36a Pull-request: https://github.com/SerenityOS/serenity/pull/11908 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/awesomekling
1 changed files with 8 additions and 2 deletions
|
@ -81,9 +81,15 @@ private:
|
|||
public:
|
||||
SinglyLinkedList() = default;
|
||||
SinglyLinkedList(const SinglyLinkedList& other) = delete;
|
||||
SinglyLinkedList(SinglyLinkedList&&) = default;
|
||||
SinglyLinkedList(SinglyLinkedList&& other)
|
||||
: m_head(other.m_head)
|
||||
, m_tail(other.m_tail)
|
||||
{
|
||||
other.m_head = nullptr;
|
||||
other.m_tail = nullptr;
|
||||
}
|
||||
SinglyLinkedList& operator=(const SinglyLinkedList& other) = delete;
|
||||
SinglyLinkedList& operator=(SinglyLinkedList&&) = default;
|
||||
SinglyLinkedList& operator=(SinglyLinkedList&&) = delete;
|
||||
|
||||
~SinglyLinkedList() { clear(); }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue