From 388fa9997b58fb5562483a519565fa72bc8796c7 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 23 Feb 2025 21:40:35 -0800 Subject: [PATCH] Add a note pointing to the holder reinterpret_cast. --- docs/advanced/smart_ptrs.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/advanced/smart_ptrs.rst b/docs/advanced/smart_ptrs.rst index 9bb82c5a0..35008dbe8 100644 --- a/docs/advanced/smart_ptrs.rst +++ b/docs/advanced/smart_ptrs.rst @@ -78,6 +78,13 @@ However, this will fail with ``py::class_`` (but works with void do_something_with_example(std::unique_ptr ex) { ... } +.. note:: + + The ``reinterpret_cast`` mentioned above is `here + `_. + For completeness: The same cast is also applied to ``py::smart_holder``, + but that is safe, because ``py::smart_holder`` is not templated. + ``std::shared_ptr`` ===================