Wenxiang Chen | 29 May 2012 01:20
Picon
Gravatar

Is there a way of advancing a iterator by multiple steps?

Hi all,


I am using Cython with some C++ facilities like vector container. 

cdef vector[int] vec

I need to obtain the relative iterator according to some index i. I knew there are at least two methods in standard C++ to achieve this:

1) vec.begin() + i
2) advance(vec.begin(), i)

It appears for me that neither of the above approaches work for Cython 0.16. Is there work around for this issue? Any help will be highly appreciated.

-Wenxiang

Gmane