C++ Library - <typeinfo>


Advertisements


Introduction

It contains type information and stores information about a type. It can be used to compare two types or to retrieve information identifying a type.

Declaration

Following is the declaration for std::type_info.

class type_info;

C++11

class type_info;

Member functions

Sr.No. Member function & description
1 operator==

It contains type information.

2 operator!=

It throws exception on failure to dynamic cast.

3 before

It throws exception on typeid of null pointe.

4 name

It throws exception on failure to dynamic cast.

5 hash_code

It throws exception on typeid of null pointe.


typeinfo.htm

Advertisements