Skip to content

Instantly share code, notes, and snippets.

@csullivan
Last active November 17, 2015 19:32
Show Gist options
  • Save csullivan/e567f0ad9b411bfd1b59 to your computer and use it in GitHub Desktop.
Save csullivan/e567f0ad9b411bfd1b59 to your computer and use it in GitHub Desktop.
Run-Time Type Information (RTTI) check with dynamic_cast
auto thing = dynamic_cast<derived_type*>(object->GetBaseObject());
if(thing!=nullptr) {
thing->MethodOfDerivedClass();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment