How to export std::vector

I'm writing application wiht boost.python library. I want to pass function into python which returnes std::vector. I have a little troubles:

inline std::vector<std::string> getConfigListValue(const std::string &key)
{
    return configManager().getListValue(key);
}

BOOST_PYTHON_MODULE(MyModule)
{
    bp::def("getListValue", getListValue);
}

When I call that function from python I get:

TypeError: No to_python (by-value) converter found for C++ type: std::vector<std::string, std::allocator<std::string> >

What have I missed?

9
задан Max Frai 15 March 2011 в 05:51
поделиться