Exposing C++ Functions with Container Arguments in Boost.Python

[This question is about Boost.Python. If there is a more approprate mailing list to send it to, please do let me know.] Hi all, This is probably a trivial question, but after some research I was unable to find a "best practice" answer, so my sincere apologies. I am trying to expose a C++ function which takes an std::vector<double> as its argument, some void A::foo(std::vector<double> v); And perhaps void A::bar(std::vector<double> & v); Whether it is a good practice to have such arguments is, of course, open to debate (shouldn't they be iterators?), but this is what I have to work with. The question remains, what is the best way to expose these to python? I cannot pass a Python list -- it's a type mismatch. Many thanks! Regards, Paul - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.

Bilokon, Paul wrote:
[This question is about Boost.Python. If there is a more approprate mailing list to send it to, please do let me know.]
I believe there is a Boost Python list somewhere.
I am trying to expose a C++ function which takes an std::vector<double> as its argument, some
http://viral.media.mit.edu/peers/doc/d559896225ab075fb7cb21f54cad008959c1d09... Should get you started. I believe you have to register each type but it escapes me how you do that. :-) -- Sohail Somani http://uint32t.blogspot.com
participants (2)
-
Bilokon, Paul
-
Sohail Somani