Re: Cost of dynamic_cast
Ole Nielsby wrote:
Tom Widmer [VC++ MVP] wrote:
[...] On Windows, [...] the same class [...] might be in the .exe
and in [...] .dlls. As a result, dynamic_cast actually performs
string comparisons [...]
Linux doesn't have this problem [...]
This explains it. The string comparisons was what really baffled me.
Nothing to do with Linux, this is compiler-specific and GCC will probably do
just pointer comparisons on win32, too, just as any other compiler might.
The better way is to avoid designs that rely heavily on dynamic_cast. Why
do you need to dynamic_cast?
For interpreting a dynamically typed programming language.
Even a dynamically typed language interpreter doesn't create new C++ types
at runtime... I'm still curious why you need so many dynamic_casts. Also, I
forgot to mention that in my last post, you might consider posting to
comp.lang.c++.moderated, which generally gives much better outcome for
non-VC specific problems.
happy hacking
Uli