From 00a91571fbf3ed58746f67aa38d379afb9d3476e Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 29 Jun 2024 12:13:19 -0700 Subject: [PATCH] fix build failure by introducing init_instance() specialization for smart_holder (test fails) --- include/pybind11/pybind11.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 3362b4d79..ef363a3ec 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1954,6 +1954,9 @@ private: /// instance. Should be called as soon as the `type` value_ptr is set for an instance. Takes /// an optional pointer to an existing holder to use; if not specified and the instance is /// `.owned`, a new holder will be constructed to manage the value pointer. + template ::value, int> + = 0> static void init_instance(detail::instance *inst, const void *holder_ptr) { auto v_h = inst->get_value_and_holder(detail::get_type_info(typeid(type))); if (!v_h.instance_registered()) { @@ -1963,6 +1966,12 @@ private: init_holder(inst, v_h, (const holder_type *) holder_ptr, v_h.value_ptr()); } + template ::value, int> = 0> + static void init_instance(detail::instance * /*inst*/, const void * /*holder_ptr*/) { + // detail::type_caster::template init_instance_for_type(inst, holder_ptr); + } + /// Deallocates an instance; via holder, if constructed; otherwise via operator delete. static void dealloc(detail::value_and_holder &v_h) { // We could be deallocating because we are cleaning up after a Python exception.