From a6abb7cff1be435ed35b2ce926cf74aad707f42b Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sun, 6 Jun 2021 16:12:07 -0700 Subject: [PATCH] Revert "Experiment: undoing even more." This reverts commit 59bc2e183e7aef5e45c06aed6965de0ac52d7b06. --- include/pybind11/detail/smart_holder_type_casters.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/pybind11/detail/smart_holder_type_casters.h b/include/pybind11/detail/smart_holder_type_casters.h index de16cdf36..050a6c124 100644 --- a/include/pybind11/detail/smart_holder_type_casters.h +++ b/include/pybind11/detail/smart_holder_type_casters.h @@ -277,12 +277,10 @@ struct smart_holder_type_caster_class_hooks : smart_holder_type_caster_base_tag using holder_type = pybindit::memory::smart_holder; -#ifdef JUNK template static bool try_initialization_using_shared_from_this(holder_type *, WrappedType *, ...) { return false; } -#endif #ifdef JUNK template @@ -316,12 +314,10 @@ struct smart_holder_type_caster_class_hooks : smart_holder_type_caster_base_tag auto holder_ptr = static_cast(holder_void_ptr); new (std::addressof(v_h.holder())) holder_type(std::move(*holder_ptr)); } else { -#ifdef JUNK if (!try_initialization_using_shared_from_this( std::addressof(v_h.holder()), v_h.value_ptr(), v_h.value_ptr())) { -#endif if (inst->owned) { new (std::addressof(v_h.holder())) holder_type( holder_type::from_raw_ptr_take_ownership(v_h.value_ptr())); @@ -329,9 +325,7 @@ struct smart_holder_type_caster_class_hooks : smart_holder_type_caster_base_tag new (std::addressof(v_h.holder())) holder_type( holder_type::from_raw_ptr_unowned(v_h.value_ptr())); } -#ifdef JUNK } -#endif } v_h.holder().pointee_depends_on_holder_owner = dynamic_raw_ptr_cast_if_possible(v_h.value_ptr()) != nullptr;