저는 boost.python 라이브러리가있는 애플리케이션을 작성하고 있습니다. 나는 std::vector
을 반환하는 파이썬으로 함수를 전달하고자합니다. 내가 파이썬에서 해당 함수를 호출 내가 얻을 때std :: vector를 내보내는 방법
inline std::vector<std::string> getConfigListValue(const std::string &key)
{
return configManager().getListValue(key);
}
BOOST_PYTHON_MODULE(MyModule)
{
bp::def("getListValue", getListValue);
}
:
TypeError: No to_python (by-value) converter found for C++ type: std::vector<std::string, std::allocator<std::string> >
무엇 내가 놓친 좀 문제가?
당신은이 같은 변환기를 작성해야
많은 감사합니다. – Ockonal
Btw, 왜'class'를'std :: allocator' 전에 작성 했습니까? – Ockonal
.... 나는 정말로 모른다! 내가 그것을 제거하고 여전히 작동합니다. –