C++ casting programmatically : can it be done?

后端 未结 8 445
你的背包
你的背包 2021-01-13 06:18

Let\'s say I have a Base class and several Derived classes. Is there any way to cast an object to one of the derived classes without the ne

8条回答
  •  太阳男子
    2021-01-13 06:44

    usually, this is a sign of a bad design. Why do you need to do this? It might be possible to redesign so that this is not needed.

提交回复
热议问题