I exposed a c++ class to python, one of its methods is something like:
boost::python::list getList() {
boost::python::list l
...
return l;
}
it works perfectly, and I dont get any compiler warning.. since I heard that working with cont开发者_开发技巧ainers is a mess with c++/python, I was just wondering if what I did is OK..
Thank you
Yes, this is the correct way of returning a list in Boost.Python. The "mess" is handled by boost::python::list
.
精彩评论