stdvector

boost::python: Python list to std::vector

boost::python: Python list to std::vector Question: Finally I’m able to use std::vector in python using the [] operator. The trick is to simple provide a container in the boost C++ wrapper which handles the internal vector stuff: #include <boost/python.hpp> #include <vector> class world { std::vector<double> myvec; void add(double n) { this->myvec.push_back(n); } std::vector<double> show() { …

Total answers: 4