Boost logo

Boost :

Subject: [boost] [python] Expose a struct with a std::vector<std::string> member
From: Tiago Coutinho (coutinhotiago_at_[hidden])
Date: 2009-02-03 05:19:58


Hello all,

          I am new to boost::python. I have access to a C++ library which I want
        to expose to python using boost. One of the structs I want to expose is
        something like:

        #include <vector>
        struct ExampleStruct
        {
                std::vector<std::string> elements;
        };

          I would like to expose this class but I like to avoid having to write
        a wrapper that would inefficiently have to copy the vector contents to a
        boost::python::list member.
          Is there a way to do this?

        Thank you very much in advance
        Cheers
        Tiago


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk