Well, I don't know if this is possible, but it will be:
struct stPiece
{
stPiece *mother;
};
vector<stPiece> pieces;
Is it possible to remove the fragment referred to by the “mother” from the pieces, having only this pointer as a link? How?
Will it mess with other links? (i.e., if it is not the last element of the vector, shifting the following elements to other memory positions, while other "mothers" remain constant). Of course, I assume that all child parts will be deleted (so I will not need to update any pointer that goes to the same mother).
Thank!
source
share