|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.announce - What's this? (Was: DMD 1.028 and 2.012 releases)
Did you notice this example in docs? (http://www.digitalmars.com/d/2.0/struct.html#AssignOverload) S* opAssign(S s) { S tmp <== *this; // bitcopy *this into tmp *this <== s; // bitcopy s into *this tmp.~this(); // call destructor on tmp return this; } It seems to be something new in D 2.012. Does it work? How? BR Marcin Kuszczak (aarti_pl) Mar 07 2008
Aarti_pl wrote:Did you notice this example in docs? (http://www.digitalmars.com/d/2.0/struct.html#AssignOverload) S* opAssign(S s) { S tmp <== *this; // bitcopy *this into tmp *this <== s; // bitcopy s into *this tmp.~this(); // call destructor on tmp return this; } It seems to be something new in D 2.012. Does it work? How? Mar 07 2008
Walter Bright pisze:Aarti_pl wrote:Did you notice this example in docs? (http://www.digitalmars.com/d/2.0/struct.html#AssignOverload) S* opAssign(S s) { S tmp <== *this; // bitcopy *this into tmp *this <== s; // bitcopy s into *this tmp.~this(); // call destructor on tmp return this; } It seems to be something new in D 2.012. Does it work? How? Mar 07 2008
Aarti_pl wrote:Walter Bright pisze:Aarti_pl wrote:Did you notice this example in docs? (http://www.digitalmars.com/d/2.0/struct.html#AssignOverload) S* opAssign(S s) { S tmp <== *this; // bitcopy *this into tmp *this <== s; // bitcopy s into *this tmp.~this(); // call destructor on tmp return this; } It seems to be something new in D 2.012. Does it work? How? Mar 07 2008
"Aarti_pl" wrote in messageDid you notice this example in docs? (http://www.digitalmars.com/d/2.0/struct.html#AssignOverload) S* opAssign(S s) { S tmp <== *this; // bitcopy *this into tmp *this <== s; // bitcopy s into *this tmp.~this(); // call destructor on tmp return this; } It seems to be something new in D 2.012. Does it work? How? BR Marcin Kuszczak (aarti_pl) Mar 07 2008
Steven Schveighoffer pisze:After reading this new feature, I'm really confused. I like the feature, but I'm not sure how it works, or why there are two functions for the same thing. Mar 07 2008
|