Converts a class pointer to a base class pointer.
A null pointer is always converted to a null pointer. If the object can't be converted to the requested type, a null pointer is returned.
It's recommended to perform the conversion by calling
method on pointer types (
instead of importing the trait directly.
Provides access to C++
dynamic_cast conversion from base class to derived class.
The conversion in opposite direction can be done with
T1 class is derived (in C++) from
T2 class (directly or indirectly),
DynamicCast<T1> is implemented for
The implementation is generated by
unsafe fn dynamic_cast(ptr: Ptr<Self>) -> Ptr<T>
Convert type of a const pointer.
Returns a null pointer if the object doesn't have the requested type.
This operation is safe as long as
ptr is either valid or null.