Top "Dynamic-cast" questions

The dynamic_cast conversion allows for safely converting pointers (and references) to classes up, down, and sideways in the inheritance hierarchy.

java: How can I do dynamic casting of a variable from one type to another?

I would like to do dynamic casting for a Java variable, the casting type is stored in a different variable. …

java casting dynamic-cast
dynamic_cast and static_cast in C++

I am quite confused with the dynamic_cast keyword in C++. struct A { virtual void f() { } }; struct B : public A { }; …

c++ casting dynamic-cast
Performance of dynamic_cast?

Before reading the question: This question is not about how useful it is to use dynamic_cast. Its just about …

c++ performance dynamic-cast boost-date-time
C#: Casting types dynamically

I currently have this type of code: private void FillObject(Object MainObject, Foo Arg1, Bar Arg2) { if (MainObject is SomeClassType1) { …

c# dynamic-cast
How to perform a dynamic_cast with a unique_ptr?

I have a class hierarchy as follows: class BaseSession : public boost::enable_shared_from_this<BaseSession> class DerivedSessionA : …

c++ boost smart-pointers unique-ptr dynamic-cast
dynamic_cast from "void *"

According to this, void* has no RTTI information, therefore casting from void* is not legal and it make sense. If …

c++ rtti void-pointers dynamic-cast
boost::shared_ptr and dynamic cast

I have a problem using a shared_ptr of a base class, I can't seem to be able to call …

c++ boost dynamic-cast boost-smart-ptr
Difference in behavior while using dynamic_cast with reference and pointers

I was checking the behavior of dynamic_cast and found that when it fails, std::bad_cast exception is thrown …

c++ casting dynamic-cast
Dynamic cast using Type of object C#

I have one abstract class named A, and other classes (B, C, D, E, ...) that implements A I also have …

c# reflection casting dynamic-cast
What is qobject_cast?

Could someone explain in as simple terms as possible (or as simple as you would like) what qobject_cast is, …

c++ qt dynamic-cast qobject