Closed
Description
When using @rwgk's smart_holder
branch and providing a custom holder type like this:
py::class_<MyClass, std::shared_ptr<MyClass>, MyBaseClass>(m, "MyClass")
.def(py::init<>());
I've got a misleading static assert:
pybind11/include/pybind11/pybind11.h:1297:13: error: static assertion failed: py::class_ holder vs type_caster mismatch: missing PYBIND11_SMART_POINTER_HOLDER_TYPE_CASTERS(T, std::shared_ptr<T>)?
1297 | !(detail::is_instantiation<std::shared_ptr, holder_type>::value
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1298 | && wrapped_type_uses_smart_holder_type_caster),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I would assume:
- That it is possible to define custom holders
- If multiple holder types are defined, a more informative assert would be thrown
Metadata
Metadata
Assignees
Labels
No labels