Wrapper to C++ Lists using Python Boost

Hi all I am relatively new to python boost and am trying to wrap a list of pairs using an iterator. In the Public section I have namespace sky{ class FindNextMask{ public: FindNextMask() {}; FindNextMask(int i):iter(i){} bool operator()(const pair<int,string>& p)const{ if (iter <= p.first) return true; else return false; } private: int iter; }; Then in another class say S class S { private: list<pair<int,string> > A; } I am unable to find a solution to this. Any help in this context would be appreciated. I know to write wrappers for pairs and vectors but I do not understand how to extend this to C++ lists and connect it with iterators and operators. class_<std::vector<std::pair<double, double> > >("VectorOfPairs") .def(vector_indexing_suite<std::vector<std::pair<double,double>
()); class_<std::pair<double, double> >("DoublePair") // Wrapper for a pair only .def_readwrite("first", &std::pair<double, double>::first) .def_readwrite("second", &std::pair<double, double>::second);
Kind Regards K.V.
participants (1)
-
Kv Gopalkrishnan