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

Another attempt to implement is_same_ptr() trait #9425

Merged
merged 3 commits into from Dec 13, 2020

Conversation

Nekotekina
Copy link
Member

@Nekotekina Nekotekina commented Dec 13, 2020

It's necessary to exploit the fact that the absolutely majority of actual inheritance is linear, in a sense, that a casting between base and derived class is a no-op with the same numeric pointer value.

It's exploited by custom shared_ptr<> implementation which always contains its control block at the negative offset, and has only one pointer inside (unlike STL shared_pointer which is double sized).

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.

None yet

1 participant