Jump to page: 1 25  
Page
Thread overview
dmd 0.37 release - operator overloading
Aug 19, 2002
Walter
Aug 19, 2002
anderson
Aug 19, 2002
Walter
Re: dmd 0.37 release - operator overloading (???)
Aug 19, 2002
anderson
Aug 19, 2002
Russ Lewis
Aug 19, 2002
Walter
Aug 19, 2002
Russ Lewis
Aug 19, 2002
Jonathan Andrew
Aug 19, 2002
Walter
Aug 19, 2002
Sean L. Palmer
Aug 19, 2002
Walter
Aug 20, 2002
Sean L. Palmer
Aug 20, 2002
Walter
Re: dmd 0.37 release - operator overloading (0/1)
Aug 20, 2002
Pavel Minayev
Re: dmd 0.37 release - operator overloading (1/1)
Aug 20, 2002
Pavel Minayev
Aug 19, 2002
Joe Battelle
Aug 19, 2002
Walter
Aug 19, 2002
Joe Battelle
Aug 19, 2002
Pavel Minayev
Aug 19, 2002
Joe Battelle
Aug 19, 2002
Pavel Minayev
Aug 19, 2002
Walter
Aug 20, 2002
Pavel Minayev
Aug 20, 2002
Walter
Aug 21, 2002
Alix Pexton
Aug 22, 2002
Carlos
Aug 22, 2002
Walter
Aug 22, 2002
Carlos
Aug 22, 2002
Walter
Aug 22, 2002
Sean L. Palmer
Aug 22, 2002
Walter
Aug 23, 2002
Pavel Minayev
Aug 23, 2002
Sean L. Palmer
Aug 23, 2002
Walter
Aug 24, 2002
Walter
Aug 24, 2002
Sean L. Palmer
Aug 24, 2002
Pavel Minayev
Aug 24, 2002
Pavel Minayev
Aug 22, 2002
Carlos
August 19, 2002
ftp://www.digitalmars.com/dmdalpha.zip

www.digitalmars.com/d/operatoroverloading.html

It doesn't do all the operators yet, but it's a start.

-Walter


August 19, 2002
Great Job!

"Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com...
> ftp://www.digitalmars.com/dmdalpha.zip
>
> www.digitalmars.com/d/operatoroverloading.html
>
> It doesn't do all the operators yet, but it's a start.
>
> -Walter
>
>


August 19, 2002
I don't understand point 4.

"4. If a or b is a struct or class object reference, it is an error. "

Do you mean?

"4. If a and b is a struct or class object reference, it is an error. "

If so do you plan on making class by class operations overloadable in a future?

Can you add an example for 4.?

"Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com...
> ftp://www.digitalmars.com/dmdalpha.zip
>
> www.digitalmars.com/d/operatoroverloading.html
>
> It doesn't do all the operators yet, but it's a start.
>
> -Walter
>
>


August 19, 2002
I believe that 4 is a fall-through if options 1-3 fail.  If you've tried to use an operator, and the classes offer no way to relate them, then it is an error.

anderson wrote:

> I don't understand point 4.
>
> "4. If a or b is a struct or class object reference, it is an error. "
>
> Do you mean?
>
> "4. If a and b is a struct or class object reference, it is an error. "
>
> If so do you plan on making class by class operations overloadable in a future?
>
> Can you add an example for 4.?
>
> "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com...
> > ftp://www.digitalmars.com/dmdalpha.zip
> >
> > www.digitalmars.com/d/operatoroverloading.html
> >
> > It doesn't do all the operators yet, but it's a start.
> >
> > -Walter
> >
> >

--
The Villagers are Online! villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]


August 19, 2002
Very good!  Now, on to the op= operators...since they are often much faster and memory efficient to implement :)

In fact, in my mathematical classes in C++, I would often implement op as derived from op= .  I would create a temporary copy of an object, use the op= function on that, and then return the temporary...

Walter wrote:

> ftp://www.digitalmars.com/dmdalpha.zip
>
> www.digitalmars.com/d/operatoroverloading.html
>
> It doesn't do all the operators yet, but it's a start.
>
> -Walter

--
The Villagers are Online! villagersonline.com

.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]


August 19, 2002
The neat thing is it turned out to be an amazingly small amount of code added to the source. -Walter

"anderson" <anderson@firestar.com.au> wrote in message news:ajqtvc$rg0$1@digitaldaemon.com...
> Great Job!
>
> "Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com...
> > ftp://www.digitalmars.com/dmdalpha.zip
> >
> > www.digitalmars.com/d/operatoroverloading.html
> >
> > It doesn't do all the operators yet, but it's a start.
> >
> > -Walter
> >
> >
>
>


August 19, 2002
"Russ Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:3D611181.FE5B9F74@deming-os.org...
> I believe that 4 is a fall-through if options 1-3 fail.  If you've tried
to
> use an operator, and the classes offer no way to relate them, then it is
an
> error.

That's right.


August 19, 2002
Walter wrote:

> ftp://www.digitalmars.com/dmdalpha.zip
>
> www.digitalmars.com/d/operatoroverloading.html
>
> It doesn't do all the operators yet, but it's a start.
>
> -Walter

I don't think it gets much simpler than that. I agree with anderson, good job!

-Jon

August 19, 2002
What happened to the nice Vector operator (Vector a) + (Vector b) {} syntax everyone was voting for?  You figured out a way around the friend problem. Some things just don't properly belong in either class and should be sorta global.

Sean

"Walter" <walter@digitalmars.com> wrote in message news:ajq4fo$311i$1@digitaldaemon.com...
> ftp://www.digitalmars.com/dmdalpha.zip
>
> www.digitalmars.com/d/operatoroverloading.html
>
> It doesn't do all the operators yet, but it's a start.
>
> -Walter



August 19, 2002
"where a is a class or struct object reference..."
Did I miss something or are we getting concrete types (in C++ parlance) as well?
All the examples show class and not struct so--maybe not yet?


« First   ‹ Prev
1 2 3 4 5