Re: opXAssign overloading

2009-10-13 Thread Don
Robert Jacques wrote: On Tue, 13 Oct 2009 00:31:32 -0400, dsimcha dsim...@yahoo.com wrote: It seems that D's operator overloading is a bit silly in some cases w.r.t. opAddAssign, opSubAssign, etc. Consider the following example: struct Foo { Foo opAdd(Foo rhs) { return this;

Re: opXAssign overloading

2009-10-13 Thread Bill Baxter
On Tue, Oct 13, 2009 at 2:30 AM, Don nos...@nospam.com wrote: Robert Jacques wrote: On Tue, 13 Oct 2009 00:31:32 -0400, dsimcha dsim...@yahoo.com wrote: It seems that D's operator overloading is a bit silly in some cases w.r.t. opAddAssign, opSubAssign, etc.  Consider the following example:

opXAssign overloading

2009-10-12 Thread dsimcha
It seems that D's operator overloading is a bit silly in some cases w.r.t. opAddAssign, opSubAssign, etc. Consider the following example: struct Foo { Foo opAdd(Foo rhs) { return this; } } void main() { Foo foo; Foo bar; foo = foo + bar; // Works. foo += bar;

Re: opXAssign overloading

2009-10-12 Thread Robert Jacques
On Tue, 13 Oct 2009 00:31:32 -0400, dsimcha dsim...@yahoo.com wrote: It seems that D's operator overloading is a bit silly in some cases w.r.t. opAddAssign, opSubAssign, etc. Consider the following example: struct Foo { Foo opAdd(Foo rhs) { return this; } } void main() {