tests: Add test for `boost::histogram::func_transform` situation. (#5582)
* Add test for boost::histogram::func_transform situation.
* Resolve clang-tidy errors
```
/__w/pybind11/pybind11/tests/test_callbacks.cpp:33:9: error: 'auto rec' can be declared as 'auto *rec' [readability-qualified-auto,-warnings-as-errors]
33 | auto rec = c.get_pointer<py::detail::function_record>();
| ^~~~
| auto *
/__w/pybind11/pybind11/tests/test_callbacks.cpp:41:13: error: 'auto cap' can be declared as 'auto *cap' [readability-qualified-auto,-warnings-as-errors]
41 | auto cap = reinterpret_cast<capture *>(&rec->data);
| ^~~~
| auto *
```
* Replace `apply_custom_transform()` implementation using `make_caster<std::function<raw_t>>`
* Add func_is_stateless_with_exact_type feature in pybind11/functional.h
* tests: use std::function::target
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
* style: pre-commit fixes
* Resolve clang-tidy error
```
/__w/pybind11/pybind11/tests/test_callbacks.cpp:33:5: error: 'auto cfunc' can be declared as 'auto *cfunc' [readability-qualified-auto,-warnings-as-errors]
33 | auto cfunc = func.target<raw_t *>();
| ^~~~
| auto *
```
---------
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>2 files changed