Skip to content

Suzcer's first version #58

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

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

Suzcer's first version #58

wants to merge 1 commit into from

Conversation

Suzcer
Copy link

@Suzcer Suzcer commented May 15, 2022

  1. 避免函数参数不必要的拷贝使用const List&或List const&
  2. 实现深拷贝步骤:将other的先顺序遍历至结尾,再倒序遍历添加(因为只有push_front函数)
  3. 改进Node的构造函数可以添加explicit,防止隐式转换
  4. 其他尚未解决,有些内容不了解,比如如果改用unique_ptr,如何在拷贝构造函数中进行结点的遍历?(因为不能将unique_ptr赋值给其他tmp,从而使得tmp去遍历等等);也不清楚为什么可以删除拷贝赋值函数,以及最后并未进行资源的释放等等。

@Suzcer
Copy link
Author

Suzcer commented May 15, 2022

  1. 避免函数参数不必要的拷贝使用const List&或List const&
  2. 实现深拷贝步骤:将other的先顺序遍历至结尾,再倒序遍历添加(因为只有push_front函数)
  3. 改进Node的构造函数可以添加explicit,防止隐式转换
  4. 其他尚未解决,有些内容不了解,比如如果改用unique_ptr,如何在拷贝构造函数中进行结点的遍历?(因为不能将unique_ptr赋值给其他tmp,从而使得tmp去遍历等等);也不清楚为什么可以删除拷贝赋值函数,以及最后并未进行资源的释放等等。

@archibate
Copy link
Contributor

archibate commented May 15, 2022 via email

@Suzcer
Copy link
Author

Suzcer commented May 15, 2022 via email

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.

2 participants