I'm trying to use pybind11's stl_bind header to no avail. I tried this:
#include <vector>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/stl_bind.h>
namespace py = pybind11;
PYBIND11_PLUGIN(test)
{
py::module m("test", "pybind11 example plugin");
py::bind_vector<std::vector<double>>(m, "std_vector");
}
But when I try to use "std_vector" in python I get this:
In [1]: import test as b
In [2]: vec = b.std_vector()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-f81a62984a4e> in <module>()
----> 1 vec = b.std_vector()
ValueError: vector::reserve
Is this a bug, or am I using pybind11 wrong?