/* example/example-stl-binder-vector.cpp -- Usage of stl_binders functions Copyright (c) 2016 Sergey Lyskov All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. */ #include "example.h" #include class El { public: El() = delete; El(int v) : a(v) { } int a; }; std::ostream & operator<<(std::ostream &s, El const&v) { s << "El{" << v.a << '}'; return s; } void init_ex_stl_binder_vector(py::module &m) { pybind11::class_(m, "El") .def(pybind11::init()); pybind11::bind_vector(m, "VectorInt"); pybind11::bind_vector(m, "VectorBool"); pybind11::bind_vector(m, "VectorEl"); pybind11::bind_vector>(m, "VectorVectorEl"); }