Thread overview | |||||
---|---|---|---|---|---|
|
March 04, 2004 overloading operator = ? | ||||
---|---|---|---|---|
| ||||
I don't see opAssign in Operator Overloading. So whether and how can I overloading operator = ? Please guide me. Thanks , |
March 04, 2004 Re: overloading operator = ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nam | Nam wrote: >I don't see opAssign in Operator Overloading. >So whether and how can I overloading operator = ? >Please guide me. >Thanks , > > You can't. -- -Anderson: http://badmama.com.au/~anderson/ |
March 05, 2004 Re: overloading operator = ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nam | "Nam" <Nam_member@pathlink.com> wrote in message news:c26cgc$rt4$1@digitaldaemon.com... > I don't see opAssign in Operator Overloading. > So whether and how can I overloading operator = ? > Please guide me. Overloading of assignment operators is deliberately omitted. I think its benefits are swamped by the confusion and code bloat it leads to. Many of the benefits in C++ of = overloading is to keep track of memory pointers. This is irrelevant in D, which does automatic memory management. Additionally, class objects in D are by reference, not by value, so an = just copies the reference, not the members. |
Copyright © 1999-2021 by the D Language Foundation