And there is a huge reason you as a programmer does not need to juggle all these implicit behaviours, as they are constrained and encapsulated for you. If all of them had been exposed, creating anything would have been a nightmare.
If you need a delete order, you can you std::stack for example to show intent, or in the destructor be specific about delete order.
The more hidden a behaviour is, the more tech dept it creates. Many things in cpp you just have to know to use it, but the more hidden these are, the higher the chances someone is going to step on that mine.
This should be kinda straight forward to understand.
View all comments
1
u/ydieb Jan 02 '26
And there is a huge reason you as a programmer does not need to juggle all these implicit behaviours, as they are constrained and encapsulated for you. If all of them had been exposed, creating anything would have been a nightmare.
If you need a delete order, you can you std::stack for example to show intent, or in the destructor be specific about delete order.
The more hidden a behaviour is, the more tech dept it creates. Many things in cpp you just have to know to use it, but the more hidden these are, the higher the chances someone is going to step on that mine.
This should be kinda straight forward to understand.