21.5 Obtaining Run-Time Typing
Information (RTTI)
2 common ways to obtain the dynamic type of an object:
- dynamic cast - for casting down the inheritance
hierarchy, checking for success
- Using the type_id operator to compare a dynamic type
to a known type
Warning: use virtual methods instead of RTTI
and complex conditionals
prev
|top
|next