FastDynamicCast icon indicating copy to clipboard operation
FastDynamicCast copied to clipboard

Cache also failed casts.

Open MarekKnapek opened this issue 8 years ago • 2 comments

MarekKnapek avatar Dec 27 '16 04:12 MarekKnapek

Hi, thanks for your PR!

I am currently in vacation, and will look at it when I am back.

tobspr avatar Dec 27 '16 18:12 tobspr

Hi Tobias, please remove both my pull requests, I just re-implemented your idea, you can have a look in my repository. My improvements are: 1) quickly return ptr or nullptr when we are casting from derived to base or from some_class to some_unrelated_class it is detectable through few templates, 2) cache also failed lookups, 3) enlarge the case to more elements (4 in my case). You have special case for casting from T to T but it doesn't work in all cases - I have the derived -> base cast as a superset of this idea. I have also simplified the reference cast. https://github.com/MarekKnapek/stuff/tree/master/C%2B%2B/fast_dynamic_cast

MarekKnapek avatar Jan 03 '17 15:01 MarekKnapek