Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But why have you designed your interface in such a way that this could happen?

A normal interface would allow you to remove one node at a time and this wouldn't occur.

A more advanced interface may allow you to remove 2 nodes, but would return a vector or a new list to ensure proper deallocation.

Don't get me wrong; you have to think with C++ and generally know what you're doing. However, you can write safe and high level C++ and I don't necessarily think thinking about your design is a bad thing.



I'm not addressing that part; I'm merely pointing out that circular references are solvable without weak references.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: