在C++中,我想知道对象的实际类型是来自同一个类,不是同一个类还是派生类.这类似于以下C#代码:
Class Base { } Class Child:Base { } Base childObject = new Child(); If (childObject.GetType() == typeof(Child)) { // do some code }
谢谢!
c++ casting typechecking
c++ ×1
casting ×1
typechecking ×1