mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
Fix build failure when shared_ptr<T> points to private std::enable_shared_from_this base (#5590)
* Squashed private_esft/manuscript — 3f2b1201b830d9e431448bd8f5fe577afaa02dbf — 2025-03-30 12:38:30 -0700 [Browse private_esft/manuscript tree](3f2b1201b8) [Browse private_esft/manuscript commits](3f2b1201b8/) * Remove mention of ChatGPT Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com> --------- Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e7e5d6e5bb
commit
8726ed22d8
@@ -473,4 +473,13 @@ TEST_SUBMODULE(smart_ptr, m) {
|
||||
}
|
||||
return list;
|
||||
});
|
||||
|
||||
class PrivateESFT : /* implicit private */ std::enable_shared_from_this<PrivateESFT> {};
|
||||
struct ContainerUsingPrivateESFT {
|
||||
std::shared_ptr<PrivateESFT> ptr;
|
||||
};
|
||||
py::class_<ContainerUsingPrivateESFT>(m, "ContainerUsingPrivateESFT")
|
||||
.def(py::init<>())
|
||||
.def_readwrite("ptr",
|
||||
&ContainerUsingPrivateESFT::ptr); // <- access ESFT through shared_ptr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user