Gettin all together, we want:

cdef extern from "foo.h":
    cclass Foo:  # or whatever else we come up with here
        Foo __add__(Foo, Foo)
        Foo __add__(Foo, int)
        int __dereference__(Foo)
        Foo __increment__(Foo) #different of inc(), right?
        cpp_Iterator __iter__() #or something like this

foo = Foo()
for inc() and dec(), there are many ways to do it;

it = foo.begin()
it = get_begin_iterator(foo) #or cython.get_begin_iterator(foo)

with types:

cdef cpp_Iterator it = foo.begin()
...

and to use in() and dec():

cython.inc(it)
foo.inc(it) #this way, it's possible to customize your own inc() and dec()
it.inc()

we just need to find the better way to use these functions/methods.

I think it would be the same for deref (only on syntax, no custom
implementation)
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to