Added move constructor and assignment operator

This commit is contained in:
Alvin Philips 2021-11-02 07:36:17 +05:30
parent b97d2b9b66
commit b36e4736f5

View File

@ -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;
}