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

finish hw02 #76

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

finish hw02 #76

wants to merge 1 commit into from

Conversation

Daydream0929
Copy link

  1. shared_ptr可能会导致循环引用,内存无法安全释放,因此采用一个unique_ptr和一个原始指针
  2. 自定义构造函数改用初始化表表达式,避免重复初始化
  3. 因为有了移动赋值函数和拷贝构造函数,删除拷贝赋值函数,当程序调用时编译器会先调用拷贝构造函数就地构造,然后调用移动赋值函数。

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