cython/cython — pull request #192 by alexis-mignon (2013-03-06 15:32:14+00:00)
Title: Adding +/- operators for c++ vector iteraors

Adding +/- operators for vector iterator allows the use of stl algorithm like "partial_sort":

```cython
from libcpp.vector import vector

ctypedef vector[float] farray
ctypedef vector[float].iterator fiter

cdef extern from "" namespace "std":
void partial_sort(fiter, fiter, fiter)

def my_partial_sort(np.ndarray[float, ndim=1] x, int k):
cdef farray arr = x
partial_sort(arr.begin(), arr.begin()+k, arr.end())
x[:] = arr
```
The += operator works properly but it leads to some problems when using it in a prange loop since the variable becomes a reduce variable.