mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Added move constructor and assignment operator
This commit is contained in:
parent
b97d2b9b66
commit
b36e4736f5
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user