📄 listassignop.cpp
字号:
#include "List.h"// Assumes the following line added to List.h in public part// List & operator=(const List &rhs)// and existence of member functions removeAll and copyListNodes// void removeAll();// void copyListNodes(const List& aList);List & List::operator=(const List& rhs){ // check for assignment to self if (this != &rhs) { removeAll(); // deallocate left-hand side copyListNodes(rhs); // copy list nodes size = rhs.size; // copy size of list } // end if return *this;} // end operator=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -