Skip to content

Long_hw_02 #77

New issue

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

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

Already on GitHub? # to your account

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

Long_hw_02 #77

wants to merge 1 commit into from

Conversation

LLong0218
Copy link

1.将共享指针改为unique+raw的组合,避免循环相互使用导致计数器不归零不释放,这里也是为什么析构函数次数不对的原因
2.把构造函数改为const &类型
3.优化了insert,原来的并没有删除多余节点
4.另外测试了一下,这里的insert逻辑上不是单纯插入而是会替换掉原来的数据,有没有更好的实现方法呢

1.将共享指针改为unique+raw的组合,避免循环相互使用导致计数器不归零不释放
2.把构造函数改为const &类型
3.优化了insert,原来的并没有删除多余节点
4.另外测试了一下,这里的insert逻辑上不是单纯插入而是会替换掉原来的数据,有没有更好的实现方法呢
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant