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

List实现构造问题 #12

Open
fengchen321 opened this issue Oct 7, 2024 · 3 comments
Open

List实现构造问题 #12

fengchen321 opened this issue Oct 7, 2024 · 3 comments

Comments

@fengchen321
Copy link

_uninit_assign 进行构造时,节点数在while之后n变为0后赋值给m_size,应为while之前赋值。

@fengchen321
Copy link
Author

迭代器 iterator-- 实现也写错了

@fengchen321
Copy link
Author

empty()实现时,_M_dummy._M_prev == _M_dummy._M_next; 如果列表只有一个元素,_M_prev 和 _M_next 都会指向虚拟节点,导致empty方法错误地返回true。应该修改成_M_dummy._M_next == &_M_dummy

@winner245 winner245 mentioned this issue Oct 20, 2024
@winner245
Copy link
Contributor

已修复,请重新 pull

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

No branches or pull requests

2 participants