/* tests/test_stl_binders.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 "pybind11_tests.h" #include #include #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; } test_initializer stl_binder_vector([](py::module &m) { py::class_(m, "El") .def(py::init()); py::bind_vector>(m, "VectorInt"); py::bind_vector>(m, "VectorBool"); py::bind_vector>(m, "VectorEl"); py::bind_vector>>(m, "VectorVectorEl"); }); test_initializer stl_binder_map([](py::module &m) { py::bind_map>(m, "MapStringDouble"); py::bind_map>(m, "UnorderedMapStringDouble"); py::bind_map>(m, "MapStringDoubleConst"); py::bind_map>(m, "UnorderedMapStringDoubleConst"); });