digitalmars.D.learn - struct + writeln
- Namespace (3/3) Nov 18 2012 Why are there so many copies of my struct if I give it to writeln?
- bearophile (5/9) Nov 18 2012 It looks the compiler is working correctly here. It seems a pure
- Artur Skawina (6/9) Nov 18 2012 phobos/writeln design issue. It just always blindly copies the things
Why are there so many copies of my struct if I give it to writeln? http://dpaste.dzfl.pl/414e7d93 This problem occurs even if I have a 'toString' method.
Nov 18 2012
Namespace:Why are there so many copies of my struct if I give it to writeln? http://dpaste.dzfl.pl/414e7d93 This problem occurs even if I have a 'toString' method.It looks the compiler is working correctly here. It seems a pure Phobos/writeln problem. Bye, bearophile
Nov 18 2012
On 11/18/12 14:15, Namespace wrote:Why are there so many copies of my struct if I give it to writeln? http://dpaste.dzfl.pl/414e7d93 This problem occurs even if I have a 'toString' method.phobos/writeln design issue. It just always blindly copies the things it needs to print/format. Unnecessary copies is not even that big a problem compared to what happens when the struct contains pointers and a non-trivial toString method... artur
Nov 18 2012