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.
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.