Dynamic Object in C++?

后端 未结 5 486
野的像风
野的像风 2021-01-24 14:12

I realize that I\'ll most likely get a lot of \"you shouldn\'t do that because...\" answers and they are most welcome and I\'ll probably totally agree with your reasoning, but I

5条回答
  •  礼貌的吻别
    2021-01-24 14:34

    Yes it is terrible. :D

    It had been done numerous times to different extents and success levels.

    QT has Qobject from which everything related to them decends.

    MFC has CObject from which eveything decends as does C++.net

    I don't know if there is a way to make it less bad, I guess if you avoid multiple inheritance like the plague (which is otherwise a useful language feature) and reimplement the stdlib it would be better. But really if that is what you are after you are probably using the wrong language for the task.

    Java and C# are much better suited to this style of programming.

    #note if I have read your question wrong just delete this answer.

提交回复
热议问题