-
Notifications
You must be signed in to change notification settings - Fork 117
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
想请教一个问题 #59
Comments
因为next作为unique_ptr已经持有了节点,prev无法再持有。
例如A→B→C→null
则next会让A持有B,B持有C
如果prev也是unique_ptr,则A持有B同时B也持有A,无法正确释放
无法顺畅的大口呼吸,是活着的最好证明
…---原始邮件---
发件人: "Wuhu Big ***@***.***>
发送时间: 2022年5月18日(周三) 晚上10:31
收件人: ***@***.***>;
抄送: ***@***.***>;
主题: [parallel101/hw02] 想请教一个问题 (Issue #59)
我看同学们作业里prev指针都是Node*,为什么不使用unique_ptr呢
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
好的,谢谢小彭老师,突然之间明白了
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2022年5月18日(星期三) 晚上11:35
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [parallel101/hw02] 想请教一个问题 (Issue #59)
因为next作为unique_ptr已经持有了节点,prev无法再持有。
例如A→B→C→null
则next会让A持有B,B持有C
如果prev也是unique_ptr,则A持有B同时B也持有A,无法正确释放
无法顺畅的大口呼吸,是活着的最好证明
---原始邮件---
发件人: "Wuhu Big ***@***.***>
发送时间: 2022年5月18日(周三) 晚上10:31
收件人: ***@***.***>;
抄送: ***@***.***>;
主题: [parallel101/hw02] 想请教一个问题 (Issue #59)
我看同学们作业里prev指针都是Node*,为什么不使用unique_ptr呢
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我看同学们作业里prev指针都是Node*,为什么不使用unique_ptr呢
The text was updated successfully, but these errors were encountered: