I’m trying to get a reference to a object in cython.
The following code compiles without problems:
cdef vector[int] a
a.push_back(1)
cdef vector[int] & b=a
However, as I add the following line:
b.push_back(1)
The compiler complains that b has been declared as a reference but not initialized.
How should I initialise a reference in cython?
(the documentation is a bit vague on the usage of references in cython)
Why not doing this :