#pragma once #include "std/utility.hpp" #include #include namespace { using namespace boost::python; // Converts a std::pair instance to a Python tuple. template struct pair_to_tuple { static PyObject * convert(pair const & p) { return incref(make_tuple(p.first, p.second).ptr()); } static PyTypeObject const * get_pytype() { return &PyTuple_Type; } }; template struct pair_to_python_converter { pair_to_python_converter() { to_python_converter, pair_to_tuple, true>(); } }; } // namespace