Hi,
I need to wrap vector of pointers, because it's parameter in one function...
I have following code:
struct X
{
X(int nn) {n=nn;}
int n;
};
BOOST_PYTHON_MODULE(myVector)
{
class_<X>("X", init<int>())
.def_readwrite("n", &X::n);
class_<std::vector<X*> >("XVec")
.def(vector_indexing_suite<std::vector<X*> >())
;
}
I want to make XVec responsible for memory, which is addressed through
pointers, but I don't know how.
>>vec=XVec()
>>a=X(7)
>>vec.append(a)
>>del a
>>vec[0].n
It prints 1682309121, but I want it to print: 7
Martin
_______________________________________________
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig