boost python怎么封装返回指针的函数

原作者:http://www.verydemo.com/demo_c122_i8276.html

boost python如何封装返回指针函数
double** Create_Double_Memory(int ySize, int xSize)
{
if (ySize <= 0 || xSize <= 0)
return NULL;

double** p = new double*[ySize];
for (int i = 0; i < ySize; i++)
p[i] = new double[xSize];

return p;
}
BOOST_PYTHON_MODULE(L1_L0_Drive)
{
def("Create_Short_Memory", Create_Short_Memory, return_value_policy<manage_new_object>());
}
编译时报错
error C2027: 使用了未定义类型“boost::STATIC_ASSERTION_FAILURE<x>”
1>  

请问如何封装返回指针函数啊?

------解决方案--------------------------------------------------------
manage_new_object返回类的动态对象,要返回简单的指针,把manage_new_object改为return_xxx_pointer,具体名字记不得了,反正有这个模板,查阅boost文档吧

相关推荐