Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wyh hw02 #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

WangYuHang-cmd
Copy link

1.将prev改成shared_ptr类型,防止首尾指针互相指向,无法释放
2.给Node的构造函数添加explicit防止隐式构造,并且使用初始化列表减少一次赋值。
3.用两个指针实现深拷贝
4.为什么删除拷贝赋值函数也不出错? 因为编译器默认使用析构函数+拷贝构造来代替拷贝赋值函数
5.print函数处:有什么值得改进的?传参const List&,减少拷贝并提高运行速度,减少运行时内存占用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant