Boost logo

Boost Users :

Subject: [Boost-users] [Python] Handling std::vector and boost::tuple
From: Johan Råde (johan.rade_at_[hidden])
Date: 2011-07-15 11:53:19


The following code fails with the error message:
"Boost.Python.ArgumentError: Python argument types in m.f(list) did not
match C++ signature: ..."

How do I make it work? Do I have to write a custom translator?

C++:
     void f(const vector<tuple<double, string, bool> >& x);

     BOOST_PYTHON_MODULE(m)
     {
         def("f", &f);
     }

Python:
     import m
     m.f([(4.3, 'abc', True)])

Thank you,
Johan Råde


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net