Merge branch 'fix-memory' of https://github.com/polarvoid/C-Plus-Plus into fix-memory

This commit is contained in:
Alvin Philips
2021-11-02 13:39:27 +05:30

View File

@@ -83,7 +83,7 @@ class CircularLinkedList {
* @brief Move constructor for CircularLinkedList * @brief Move constructor for CircularLinkedList
* @param source rvalue reference to a Circular Linked List * @param source rvalue reference to a Circular Linked List
*/ */
CircularLinkedList(CircularLinkedList&& source) { CircularLinkedList(CircularLinkedList&& source) noexcept {
root = source.root; root = source.root;
end = source.end; end = source.end;
source.root = nullptr; source.root = nullptr;
@@ -108,7 +108,7 @@ class CircularLinkedList {
* @param other rvalue reference to a Circular Linked List * @param other rvalue reference to a Circular Linked List
* @returns Reference to CircularLinkedList * @returns Reference to CircularLinkedList
*/ */
CircularLinkedList& operator=(CircularLinkedList&& other) { CircularLinkedList& operator=(CircularLinkedList&& other) noexcept {
root = other.root; root = other.root;
end = other.end; end = other.end;
other.root = nullptr; other.root = nullptr;