%cython
#clang c++
from libcpp.vector cimport vector as cvector
from libcpp.list cimport list as clist
from cython.operator cimport dereference as deref, preincrement as inc
cdef extern from "stdlib.h":
void free(void* ptr)
void* malloc(size_t size)
void* realloc(void* ptr, size_t size)
cdef cvector[clist[int]] *v
cdef clist[int] *l
v = new cvector[clist[int]]()
l = new clist[int]()
#v= < cvector[clist[int]] * > malloc(1*sizeof(cvector[clist[int]]))
#l= < clist[int] * > malloc(1*sizeof(clist[int]))
Error compiling Cython file:
------------------------------------------------------------
...
cdef cvector[clist[int]] *v
cdef clist[int] *l
v = new cvector[clist[int]]()
^
------------------------------------------------------------
_[...]_sage52_spyx_0.pyx:17:8: Operation only allowed in c++
Using malloc instead of new:
Error compiling Cython file:
------------------------------------------------------------
...
#v = new cvector[clist[int]]()
#l = new clist[int]()
v= < cvector[clist[int]] * > malloc(1*sizeof(cvector[clist[int]]))
^
------------------------------------------------------------
_[...]_sage54_spyx_0.pyx:20:25: Unknown type