Boost logo

Boost Users :

From: Bruno Lalande (bruno.lalande_at_[hidden])
Date: 2008-04-28 04:26:45


Hi,

You can use the provided vector indexing suite. If I remember well,
all you have to do is including the header and defining a vector class
for each type of vector you want to use:

#include <boost/python/suite/indexing/vector_indexing_suite.hpp>

class_<std::vector<pt_coords> >("coords_vector")
    .def(vector_indexing_suite<std::vector<pt_coords> >())
;

Your vector will be a known class once in Python, and you'll be able
to use it like a Python list.

Bruno


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