From b97d2b9b66506aa48b3dff7a45abd280bb7f042b Mon Sep 17 00:00:00 2001 From: Alvin Philips Date: Tue, 2 Nov 2021 07:30:28 +0530 Subject: [PATCH] Update circular_linked_list.cpp --- operations_on_datastructures/circular_linked_list.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */