Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
作业要求
避免函数参数不必要的拷贝 5 分
print()
和push_front()
改为常量参数传递,避免拷贝修复智能指针造成的问题 10 分
shared_ptr
循环引用造成内存无法释放改用
unique_ptr<Node>
10 分实现拷贝构造函数为深拷贝 15 分
说明为什么可以删除拷贝赋值函数 5 分
改进
Node
的构造函数 5 分模板
List和Node类都实现为模板类,并用
List<double>
测试成功迭代器
实现了
list_iterator
,拷贝构造时深拷贝的遍历操作使用迭代器完成