I have a method in c++ that gets called from python and needs to return a python list object.
I have already created the method, and its attached to an exposed class
I have this function using iterators to convert std::vector to py::list:
std::vector
py::list
namespace py = boost::python; template py::list std_vector_to_py_list(const std::vector& v) { py::object get_iter = py::iterator >(); py::object iter = get_iter(v); py::list l(iter); return l; }