Skip to content

Commit 388fa99

Browse files
committed
Add a note pointing to the holder reinterpret_cast.
1 parent 7cae21f commit 388fa99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/advanced/smart_ptrs.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ However, this will fail with ``py::class_<Example>`` (but works with
7878
7979
void do_something_with_example(std::unique_ptr<Example> ex) { ... }
8080
81+
.. note::
82+
83+
The ``reinterpret_cast`` mentioned above is `here
84+
<https://github.com/pybind/pybind11/blob/30eb39ed79d1e2eeff15219ac00773034300a5e6/include/pybind11/cast.h#L235>`_.
85+
For completeness: The same cast is also applied to ``py::smart_holder``,
86+
but that is safe, because ``py::smart_holder`` is not templated.
87+
8188

8289
``std::shared_ptr``
8390
===================

0 commit comments

Comments
 (0)