/* example/example17.cpp -- Usage of stl_binders functions Copyright (c) 2016 Wenzel Jakob 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 A { public: A() = delete; A(int v) :a(v) {} int a; }; std::ostream & operator<<(std::ostream &s, A const&v) { s << "A{" << v.a << '}'; return s; } void init_ex17(py::module &m) { pybind11::class_(m, "A") .def(pybind11::init()); pybind11::vector_binder(m, "VectorInt"); pybind11::vector_binder(m, "VectorA"); }