mirror of
https://github.com/huihut/interview.git
synced 2026-03-13 10:02:55 +08:00
fix typeid
https://github.com/huihut/interview/issues/12#issuecomment-860158224
This commit is contained in:
@@ -1173,7 +1173,7 @@ catch (bad_cast b) {
|
||||
#### typeid
|
||||
|
||||
* typeid 运算符允许在运行时确定对象的类型
|
||||
* type\_id 返回一个 type\_info 对象的引用
|
||||
* typeid 返回一个 type\_info 对象的引用
|
||||
* 如果想通过基类的指针获得派生类的数据类型,基类必须带有虚函数
|
||||
* 只能获取对象的实际类型
|
||||
|
||||
|
||||
@@ -1180,7 +1180,7 @@ catch (bad_cast b) {
|
||||
#### typeid
|
||||
|
||||
* The typeid operator allows determining the type of an object at runtime
|
||||
* type \ _id returns a reference to a type \ _info object
|
||||
* typeid returns a reference to a type\_info object
|
||||
* If you want to get the data type of the derived class through the pointer of the base class, the base class must have a virtual function
|
||||
* Can only get the actual type of the object
|
||||
|
||||
|
||||
Reference in New Issue
Block a user