D - overloading operator = ?
- Nam (4/4) Mar 03 2004 I don't see opAssign in Operator Overloading.
- J Anderson (4/9) Mar 03 2004 You can't.
- Walter (8/11) Mar 05 2004 Overloading of assignment operators is deliberately omitted. I think its
I don't see opAssign in Operator Overloading. So whether and how can I overloading operator = ? Please guide me. Thanks ,
Mar 03 2004
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/
Mar 03 2004
"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.
Mar 05 2004