diff --git a/operations_on_datastructures/circular_linked_list.cpp b/operations_on_datastructures/circular_linked_list.cpp index 2ec624ace..2ddb626db 100644 --- a/operations_on_datastructures/circular_linked_list.cpp +++ b/operations_on_datastructures/circular_linked_list.cpp @@ -74,7 +74,15 @@ class CircularLinkedList { root = copy.root; end = copy.end; } - void operator=(const CircularLinkedList& other) { + CircularLinkedList(CircularLinkedList&& source) { + root = source.root; + end = source.end; + } + CircularLinkedList& operator=(const CircularLinkedList& other) { + root = other.root; + end = other.end; + } + CircularLinkedList& operator=(CircularLinkedList&& other) { root = other.root; end = other.end; }