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

I believe this was one of the main things he was actually trying to achieve - By embedding the linked list declarations inside the object, you can make sure to 'balance' all of them in destructors, and from a single place you can ensure that the object is never deleted without all references being removed.

I feel like this kind of problem is actually a specific instance of a much larger problem - that being explicit about these things leads to more maintainable code, at the expense of some 'leet things' that can cause troubles if not implemented perfectly.



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

Search: