Can't use holders around types with custom converters
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
This fails for any T with a custom type converter (e.g. std::string, Eigen::MatrixXd, MyCustomConvertingType, etc.):
m.def("f", [](std::shared_ptr<T>) {})
The issue is that the holder type casters assume that type_caster<T> is a type_caster_base<T>, and make use of type_caster_base<T> constructors and internals. #786 makes it into a compile-time failure (before that it will result in strange run-time failures as we end up invoking a generic caster on an unregistered type).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the holder type casters and the type_caster assumptions described in the issue, then reproduce the compile-time failure using the shared_ptr binding snippet with a custom converter. Done means holders work with custom-converted types without relying on type_caster_base internals or invoking a generic caster for an unregistered type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100