Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache also failed casts. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Cache also failed casts. #5

wants to merge 1 commit into from

Conversation

MarekKnapek
Copy link

No description provided.

@tobspr
Copy link
Owner

tobspr commented Dec 27, 2016

Hi, thanks for your PR!

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

@MarekKnapek
Copy link
Author

MarekKnapek commented Jan 3, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants