Run-TimeTypeIdentification文稿.pptVIP

  • 2
  • 0
  • 约1.92千字
  • 约 8页
  • 2016-12-03 发布于山西
  • 举报
Run-TimeTypeIdentification文稿

Run-Time Type Identification Jim Fawcett CSE687 – Object Oriented Design Spring 2007 Typeid The function: const typeinfo typeid(arg) returns a const typeinfo object when passed an object, reference, or pointer. Typeinfo: class type_info { public: virtual ~type_info(); int operator==(const type_info rhs) const; int operator!=(const type_info rhs) const; int before(const type_info rhs) const; const char* name() const; const char* raw_name() const; private: ... }; Examples of typeid() use class foo { … }; typeid(foo).name() returns “foo” foo *ptr;

文档评论(0)

1亿VIP精品文档

相关文档