PROPOSAL: Operator overloading by static member function

Janice Caron caron800 at googlemail.com
Sat Oct 13 23:26:12 PDT 2007


On 10/14/07, Janice Caron <caron800 at googlemail.com> wrote:
> On 10/14/07, Daniel Keep <daniel.keep.lists at gmail.com> wrote:
> > auto distance = 20*m;
>
> Oh that is cool!

I guess you could generalise that...

auto area = 100*m*m;
auto velocity = 50*m/s;
const G = 6.673e-11*m*m*m*/kg/s/s;

...and even do unit conversions...

auto distance = 15*miles; /*converts to meters*/

Super duper. OK, I'm all in favor of keeping thing the way they are,
coz that's just so brilliant.



More information about the Digitalmars-d mailing list