diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 388e0da8d..017b2c655 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1294,7 +1294,16 @@ public: record.holder_size = sizeof(holder_type); record.init_instance = init_instance; record.dealloc = dealloc; +#ifndef PYBIND11_USE_SMART_HOLDER_AS_DEFAULT record.default_holder = detail::is_instantiation::value; +#else + record.default_holder = std::is_same::value; +#if 0 + static_assert(!(detail::is_instantiation::value && detail::is_smart_holder_type_caster::value)); + static_assert(!(detail::is_instantiation::value && detail::is_smart_holder_type_caster::value)); + static_assert(detail::is_smart_holder_type_caster::value == std::is_same::value); +#endif +#endif set_operator_new(&record);