
16 Apr
2009
16 Apr
'09
12:50 a.m.
Hi, I am wondering if anyone has a working example of exposing std::pair as a Python tuple or list. Technically, I need to expose a vector of tuples and the following works class_<std::vector<std::pair<std::string, double> > >("VectorPair") .def(vector_indexing_suite<std::vector<std::pair<std::string, double> > >()) ; but I am not sure how then to expose the std::pair. I am guessing I should use boost/python/tuple.hpp or list.hpp but can't figure out the syntax. Thanks in advance.