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

Allow std::enable_shared_from_this when using const element type #260

Merged
merged 1 commit into from
Jul 1, 2016
Merged

Allow std::enable_shared_from_this when using const element type #260

merged 1 commit into from
Jul 1, 2016

Conversation

hbruintjes
Copy link
Contributor

The call to std::static_pointer_cast for a std::enable_shared_from_this holder should probably use the type as declared in the binding holder (as opposed to the type itself). This allows a std::shared_ptr to be used even if the element type is not identical, such as when it is const and/or derived (our particular use case).

This is related to #131, and commit 309a85b

…ared_from_this.

Allows const types to be used by shared_ptr
@wjakob
Copy link
Member

wjakob commented Jul 1, 2016

LGTM, thanks!

@wjakob wjakob merged commit d7e208c into pybind:master Jul 1, 2016
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