MCPcopy Create free account
hub / github.com/DFHack/dfhack / virtual_cast

Function virtual_cast

library/include/DataDefs.h:489–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487
488 template<class T>
489 inline T *virtual_cast(virtual_ptr ptr) {
490 return T::_identity.is_instance(ptr) ? static_cast<T*>(ptr) : NULL;
491 }
492
493#define VIRTUAL_CAST_VAR(var,type,input) type *var = virtual_cast<type>(input)
494

Callers

nothing calls this directly

Calls 1

is_instanceMethod · 0.80

Tested by

no test coverage detected