Is C++ shared pointers the solution?
Adding a dead boolean field, then all the entities with links removes their pointers when possible by looking at the dead field, at the end the object is freed.
Adding a dead boolean field, then all the entities with links removes their pointers when possible by looking at the dead field, at the end the object is freed.
But it's considered too slow (or too unpredictable) for games.
The only nuisance is the lack of reflection in C++, as usual.