开发者

returning boost list from exposed class

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜