mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-03 10:35:34 +08:00
Added move constructor and assignment operator
This commit is contained in:
@@ -74,7 +74,15 @@ class CircularLinkedList {
|
|||||||
root = copy.root;
|
root = copy.root;
|
||||||
end = copy.end;
|
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;
|
root = other.root;
|
||||||
end = other.end;
|
end = other.end;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user