ILE C/C++ Programmer's Guide
The C++ language supports both the re-use of code and the building of
programs from parts. There might be incompatibilities between RTTI
mechanisms used internally by various C++ libraries. The RTTI language
extension resolves those incompatibilities.
C++ language support for RTTI include:
- dynamic_cast operator
- This operator combines type-checking and casting in one operation.
It checks whether the requested cast is valid, and performs the cast only if
it is valid.
- typeid operator
- This operator returns the run-time type of an object. If the
operand provided to the typeid operator is the name of a type, the
operator returns a type_info object that identifies it. If
the operand provided is an expression, typeid returns the type of
the object that the expression denotes.
- type_info class
- This class describes the RTTI available, and is used to define the type
returned by the typeid operator. This class provides to
users the possibility of shaping and extending RTTI to suit their own
needs. This ability is of most interest to implementers of object I/O
systems such as debuggers or database systems.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.