I have a piece of C++ code as follows: template <typename ...A> struct CastAll{ template <typename ...B>
dynamic_casts are slow开发者_开发问答er, but they are safer than static_casts (when used with object hierarchies, of course). My question is, after I\'ve ensured in my debug code that all (dynamic) ca
Given a class and subclass: class Event {...} class Note : public Event {...} A Note is Cloned and stored in a pointer within a function f(). The type-information is preserved in the pointer and ca
According to what I read, performing a wrong run-time dynamic_cast can either throw a bad_cast exception or return zero.
A little while ago, I found that very interesting paper on a very neat performance upgrade for dynamic_cast in C++: http://www2.research.att.com/~bs/fast_dynamic_casting.pdf.
I\'m looking for advice on refactoring to improve my class design and avoid type checking. I am using the Command design pattern to construct a menu tree. An item in the menu could be of various type
This is somewhat hypothetical as I\'m not too worried about performance - just wondering which option is actually the fastest/most efficient in general, or if there is no difference whatsoever.
I\'m currently trying to roll my own \"marshal\" code for python so i can store compiled python code on Google App Engine to serve scripts on a dynamic way. As you all can verify, \"marshal\" isn\'t s
I am trying to determine whether an object pointed by a T* pointer is truly a T object, or some other, unrelated type. I tried dynamic_cast, however it is less than useless, it returns the pointer its
I came across this: struct Base { void* operator new (size_t); void operator delete (void*); virtual ~Base () {}// <--- polymorphic