RTTI – easiest tiny summary

Based on P 164 [[essential c++]]…

RTTI construct: typeid( *somePtr)// must unwrap
RTTI construct: typeid(someRef)
RTTI construct: dynamic_cast
RTTI construct: dynamic_cast

I believe this is the full list of RTTI constructs and they all needs vtbl. This post is a summary. The post on dynamic_cast and typeid is more in-depth including a nice example.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s