Skip to content

Support std::shared_ptr holder type out of the box#454

Merged
wjakob merged 1 commit into
pybind:masterfrom
dean0x7d:shared_ptr
Oct 20, 2016
Merged

Support std::shared_ptr holder type out of the box#454
wjakob merged 1 commit into
pybind:masterfrom
dean0x7d:shared_ptr

Conversation

@dean0x7d

Copy link
Copy Markdown
Member

As discussed in #446. With this there is no more need for manual user declarations like PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>). The macro was removed from all the tests except one in order to make sure it still compiles and is ignored silently.

The documentation was split up to indicate the special status of std::shared_ptr compared to custom smart pointers.

With this there is no more need for manual user declarations like
`PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)`. Existing ones
will still compile without error -- they will just be ignored silently.

Resolves pybind#446.
@wjakob

wjakob commented Oct 20, 2016

Copy link
Copy Markdown
Member

Looks great, thank you!

@wjakob
wjakob merged commit 77898af into pybind:master Oct 20, 2016
@dean0x7d
dean0x7d deleted the shared_ptr branch October 21, 2016 16:14
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