diff --git a/operations_on_datastructures/circular_linked_list.cpp b/operations_on_datastructures/circular_linked_list.cpp index 89b94e2fb..2ec624ace 100644 --- a/operations_on_datastructures/circular_linked_list.cpp +++ b/operations_on_datastructures/circular_linked_list.cpp @@ -70,10 +70,14 @@ class CircularLinkedList { /** * @brief Copy constructor for CircularLinkedList. */ - CircularLinkedList(CircularLinkedList& copy) { + CircularLinkedList(const CircularLinkedList& copy) { root = copy.root; end = copy.end; } + void operator=(const CircularLinkedList& other) { + root = other.root; + end = other.end; + } /** * @brief Cleans up memory */