mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-13 17:56:02 +00:00
Adding reclaim_disowned logic & miscellaneous naming and documentation improvements. (#2943)
* Using new smart_holder::reclaim_disowned in smart_holder_type_caster for unique_ptr. * Systematically renaming was_disowned to is_disowned (because disowning is now reversible: reclaim_disowned). * Systematically renaming virtual_overrider_self_life_support to trampoline_self_life_support (to reuse existing terminology instead of introducing new one). * Systematically renaming test_class_sh_with_alias to test_class_sh_trampoline_basic. * Adding a Trampolines and std::unique_ptr section to README_smart_holder.rst. * MSVC compatibility.
This commit is contained in:
committed by
GitHub
parent
88a09988e7
commit
6c922614ed
@@ -31,13 +31,13 @@ int get_from_cpp_plainc_ptr(const Base *b) { return b->get() + 4000; }
|
||||
|
||||
int get_from_cpp_unique_ptr(std::unique_ptr<Base> b) { return b->get() + 5000; }
|
||||
|
||||
struct BaseVirtualOverrider : Base, py::virtual_overrider_self_life_support {
|
||||
struct BaseVirtualOverrider : Base, py::trampoline_self_life_support {
|
||||
using Base::Base;
|
||||
|
||||
int get() const override { PYBIND11_OVERRIDE(int, Base, get); }
|
||||
};
|
||||
|
||||
struct CppDerivedVirtualOverrider : CppDerived, py::virtual_overrider_self_life_support {
|
||||
struct CppDerivedVirtualOverrider : CppDerived, py::trampoline_self_life_support {
|
||||
using CppDerived::CppDerived;
|
||||
|
||||
int get() const override { PYBIND11_OVERRIDE(int, CppDerived, get); }
|
||||
|
||||
Reference in New Issue
Block a user