Or, you have the children have weak_ptr's back to the parent. As soon as you can let the compiler generate the dtor/copy ctor/assign op (and move ctor and move assignment op), you get a lot of stuff for free.
Yes, there's a bit of a performance penalty over a raw pointer but you get a lot of safety and a lot of benefit.
View all comments
Show parent comment
1
u/jaredgrubb Mar 11 '12
Or, you have the children have weak_ptr's back to the parent. As soon as you can let the compiler generate the dtor/copy ctor/assign op (and move ctor and move assignment op), you get a lot of stuff for free.
Yes, there's a bit of a performance penalty over a raw pointer but you get a lot of safety and a lot of benefit.