> > Yes. (Though my vote is for my_list.begin() and my_list.end() instead.) > Yes. It may be better so, through we have it similar in C++ (list<T>::iterator it = myList.begin();)
> The main issue with using STL iterators in Cython though is what types > to add. > > > For comparison, this is how it is /currently/ possible in Cython to do this: > > # the proper extern declarations > > # use vector in example, then we don't need inc/dec/deref > > cdef cpp_vector_int* vec = new_cpp_vector_int() > cdef cpp_vector_int_iterator* it = \ > new_cpp_vector_int_iterator(vec.begin()) > cdef cpp_vector_int_iterator* end = \ > new_cpp_vector_int_iterator(vec.end()) > > while it[0] != end[0]: > if something = it[0][0]: > break > it[0] += 1 > > cpp_delete(it) > cpp_delete(end) > cpp_delete(vec) > > > Not pretty. The types are the problem -- if one could simply do > > cdef cpp_vector_int_iterator it = vec.begin() > > things would look much nicer. > Is it all implemented dinamically? If we find a way to implement it static, or just doing it dinamic, but automated, we could avoid cpp_delete() (I dont't know ow this works in C++) _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
