typeid [C++ Reference]
Keywords: keywords,typeid
Date: 2010-04-28T06:39:46-0700

[[typeid]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## typeid

Syntax:

        typeid( object );

The typeid operator returns a reference to a type_info object that describes `object`.

If `object` is a null pointer, then the operation will throw a std::bad_typeid exception.

NOTE The C++98 standard requires that header file `<typeinfo>` to be included before operator typeid is used within a compilation unit. Otherwise, the program is considered ill-formed.

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •