Skip to content

Commit 57ec31b

Browse files
committed
Revert "Experiment: undoing even more."
This reverts commit 59bc2e1.
1 parent 8e27bcf commit 57ec31b

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

include/pybind11/detail/smart_holder_type_casters.h

-6
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,10 @@ struct smart_holder_type_caster_class_hooks : smart_holder_type_caster_base_tag
273273

274274
using holder_type = pybindit::memory::smart_holder;
275275

276-
#ifdef JUNK
277276
template <typename WrappedType>
278277
static bool try_initialization_using_shared_from_this(holder_type *, WrappedType *, ...) {
279278
return false;
280279
}
281-
#endif
282280

283281
#ifdef JUNK
284282
template <typename WrappedType, typename AnyBaseOfWrappedType>
@@ -312,22 +310,18 @@ struct smart_holder_type_caster_class_hooks : smart_holder_type_caster_base_tag
312310
auto holder_ptr = static_cast<holder_type *>(holder_void_ptr);
313311
new (std::addressof(v_h.holder<holder_type>())) holder_type(std::move(*holder_ptr));
314312
} else {
315-
#ifdef JUNK
316313
if (!try_initialization_using_shared_from_this(
317314
std::addressof(v_h.holder<holder_type>()),
318315
v_h.value_ptr<WrappedType>(),
319316
v_h.value_ptr<WrappedType>())) {
320-
#endif
321317
if (inst->owned) {
322318
new (std::addressof(v_h.holder<holder_type>())) holder_type(
323319
holder_type::from_raw_ptr_take_ownership(v_h.value_ptr<WrappedType>()));
324320
} else {
325321
new (std::addressof(v_h.holder<holder_type>())) holder_type(
326322
holder_type::from_raw_ptr_unowned(v_h.value_ptr<WrappedType>()));
327323
}
328-
#ifdef JUNK
329324
}
330-
#endif
331325
}
332326
v_h.holder<holder_type>().pointee_depends_on_holder_owner
333327
= dynamic_raw_ptr_cast_if_possible<AliasType>(v_h.value_ptr<WrappedType>()) != nullptr;

0 commit comments

Comments
 (0)