mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
Fix STL casters for containers with proxies (regression)
To avoid an ODR violation in the test suite while testing both `stl.h` and `std_bind.h` with `std::vector<bool>`, the `py::bind_vector<std::vector<bool>>` test is moved to the secondary module (which does not include `stl.h`).
This commit is contained in:
@@ -104,4 +104,10 @@ PYBIND11_MODULE(pybind11_cross_module_tests, m) {
|
||||
m.def("get_gl_value", [](MixGL &o) { return o.i + 100; });
|
||||
|
||||
py::class_<MixGL2>(m, "MixGL2", py::module_local()).def(py::init<int>());
|
||||
|
||||
// test_vector_bool
|
||||
// We can't test both stl.h and stl_bind.h conversions of `std::vector<bool>` within
|
||||
// the same module (it would be an ODR violation). Therefore `bind_vector` of `bool`
|
||||
// is defined here and tested in `test_stl_binders.py`.
|
||||
py::bind_vector<std::vector<bool>>(m, "VectorBool");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user