Skip to content

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