Skip to content

pybind::vector doesnt compile with VS 15.9.x #1616

Closed
@vdolbakyan

Description

@vdolbakyan

Issue description

Simple pybind::vector usage doesn't compile with VS 15.9.x
PYBIND11_MAKE_OPAQUE(std::vector);
...
py::bind_vectorstd::vector(m, "BoolList");

stl_bind.h(386): error C2672: 'pybind11::detail::vector_buffer': no matching overloaded function found
core_submodule.cpp(19): note: see reference to function template instantiation 'pybind11::class_<std::vector<bool,std::allocator<_Ty>>,std::unique_ptr<Vector,std::default_delete<std::vector<_Ty,std::allocator<_Ty>>>>> pybind11::bind_vector<std::vector<_Ty,std::allocator<_Ty>>,std::unique_ptr<Vector,std::default_delete<std::vector<_Ty,std::allocator<_Ty>>>>,>(pybind11::handle,const std::string &)' being compiled
with
[
_Ty=bool,
Vector=std::vector<bool,std::allocator>
]
include\pybind11\stl_bind.h(374): error C2893: Failed to specialize function template 'enable_if<Test,Ty>::type pybind11::detail::vector_buffer(Class &)'
with
[
Ty=void
]
\include\pybind11\stl_bind.h(374): note: With the following template arguments:
\include\pybind11\stl_bind.h(374): note: 'Vector=Vector'
\include\pybind11\stl_bind.h(374): note: 'Class
=Class
'
\include\pybind11\stl_bind.h(374): note: 'Args={}'

Reproducible example code

PYBIND11_MAKE_OPAQUE(std::vectorstd::int8_t);

...
py::bind_vector<std::vector>(m, "BoolList");

(The code should be minimal, have no external dependencies, isolate the function(s) that cause breakage. Submit matched and complete C++ and Python snippets that can be easily compiled and run to diagnose the issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions