Ecere SDK/eC Forums
https://ecere.org/community/
Print view

Operator Overloading (Missing feature?)
https://ecere.org/community/viewtopic.php?f=1&t=127
Page 1 of 1
Author:  redj [ Wed Feb 09, 2011 11:31 am ]
Post subject:  Operator Overloading (Missing feature?)

Question from JF:
Operator overloading?

Note that A little introduction to eC mentions operator overloading.

-redj
Author:  jerome [ Wed Feb 09, 2011 2:32 pm ]
Post subject:  Re: Operator Overloading (Missing feature?)

I believe I meant to talk about eC's great unit systems and conversion properties in that little introduction.

This supports things like:

Degrees a = Radians { pi/4 } + Degrees { 60 };

(See attached 'units' test)

It's another way eC advocates 'clear execution points', one thing happening only at one place.
(As opposed to e.g. overload a + and += and - and -= operator, in eC you simply define a conversion function to go to reach a 'common ground, and then the regular C operators work).

The PrintLn syntax mentioned there is eC's alternative to the C++ cout << a << b;

Now operator overloading would be useful for things like vector , matrix and quaternion operations.
For this, we hope to develop some kind of operator overloading support, but that is not done yet.

Our Utopian 'String' class is still something eC is missing, and whether it will overload the + for concatenation or not is still to be disputed.
All times are UTC-05:00 Page 1 of 1