Is it bad practice for a child object to have a pointer to its parent?

前端 未结 7 1741
我寻月下人不归
我寻月下人不归 2020-12-20 12:27

In a C++ application, let\'s say I have a window class, which has several instances of a control class. If my window wanted to notify a control that it had been clicked, I m

相关标签:
7条回答
  • 2020-12-20 13:17

    If you need to do it, consider passing the parent as a const*.

    0 讨论(0)
提交回复
热议问题