By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,630 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,630 IT Pros & Developers. It's quick & easy.

Support for C++ std::vector in Python wrapper

P: 1
Hi all,

I am new to Python so apologies in advance for my ignorance. I have created a C++ DLL which needs to be wrapped for Python users.

The problem is that some of the functions for my DLL require std::vector as argument to be passed. From what I understand, the equivalent in Python to std::vector is list.

This is the definition of the fucntion that needs the std::vector:
int userStreamInput( const std::vector <unsigned char > & )


class_< UIImpl >( "RFCPython" )
.def( init< const std::string& > () )
.def( "stream", &UIImpl::userStreamInput )

Does anyone have suggestions on how to pass a std::vector to my function?


Dec 4 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.