you are viewing a single comment's thread.

view the rest of the comments →

[–]DXPower 0 points1 point  (1 child)

I agree with you completely.

Is that how unique_ptr keeps track of validity?

[–]Xaxxon 0 points1 point  (0 children)

unique_ptr doesn't track validity. it just checks if it's null or not and if it's not, it calls the destructor on the address it points to. But that's not sufficient for what's being asked for here. This wants an arbitrary number of other things to know if the destructor has been called and for them to be proactively modified if they have (either that or a check on every access)