mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-20 20:07:45 +08:00
Added move constructor and assignment operator
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user