I'll consider all this for my project on GSoC.
For overloading operators, template maybe solve this, maybe not.
But I don't think using template for this is a good idea.
The following code:
cdef extern from "Rectangle.h":
ctypedef struct Rectangle:
Rectangle(int) # constructor takes an int
Rectangle operator+(Rectangle)
Coordinate& operator[](Corner corner) # & means result is assignable
from Dag wiki for enchacements, as said there, a change in the parser
will be needed.
I think that if we can make the syntax closer to Python, it would be better.
We could use something like __cadd__, __csetitem__, __cgetitem__, etc.
I think it would be more interesting, and still more for Cython users
(I think Cython users know more Python than C/C++).
But for all this, changes in the parser are needed.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev