typeid参数
来源:互联网 发布:汇航亿胜网络推手公司 编辑:程序博客网 时间:2024/06/05 20:13
http://msdn.microsoft.com/en-us/library/fyf39xec(v=VS.80).aspx
If the expression points to a base class type, yet the object is actually of a type derived from that base class, a type_info reference for the derived class is the result. The expression must point to a polymorphic type (a class with virtual functions). Otherwise, the result is the type_info for the static class referred to in the expression. Further, the pointer must be dereferenced so that the object it points to is used. Without dereferencing the pointer, the result will be the type_info for the pointer, not what it points to. For example:
// expre_typeid_Operator.cpp// compile with: /GR /EHsc#include <iostream>#include <typeinfo.h>class Base {public: virtual void vvfunc() {}};class Derived : public Base {};using namespace std;int main() { Derived* pd = new Derived; Base* pb = pd; cout << typeid( pb ).name() << endl; //prints "class Base *" cout << typeid( *pb ).name() << endl; //prints "class Derived" cout << typeid( pd ).name() << endl; //prints "class Derived *" cout << typeid( *pd ).name() << endl; //prints "class Derived" delete pd;}
- typeid参数
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- typeid
- 1.1.22.typeid()关键字 (RTTI支持) typeid 的参数必须含有虚函数才能实现以下功能
- typeid用法
- typeid 一节
- typeid-4
- Windows Azure 和必应地图通过交互的网站将Speilberg的“War Horse”的历史带进生活
- IE 浏览器版本判断
- 基于大顶堆实现的最大优先级队列
- uint8_t / uint16_t / uint32_t /uint64_t 数据类型
- linux tar打包解压详解
- typeid参数
- atmel9260上linux socketcan MCP2515调试笔记
- ubuntu11.10 安装 qt卡死
- ORACLE SQL性能优化系列 (二)
- SQL日期查询
- Valgrind的下载安装
- 16.2.1 使用 switch 函数
- windows xp 下 部署 servlet 步骤及原理简述
- JAVA学习笔记4