digitalmars.D - std.stdio and copying
- Luc Bourhis (9/9) Jan 22 2015 If s is the instance of some struct S, "write(s)" will first copy
- Kagamin (1/1) Jan 22 2015 Somewhat related: https://issues.dlang.org/show_bug.cgi?id=13586
If s is the instance of some struct S, "write(s)" will first copy s. Not only this can be very inefficient but it won't even compile if S features " disable this(this)". The same goes for all the other functions, including format("s=%s", s) One is then force to manually insert "s.toString()". Not quite a good fit for the overhaul elegance of D imho. Wouldn't it be nice to have those I/O functions support "const ref" for struct's? Or am I missing something?
Jan 22 2015
Somewhat related: https://issues.dlang.org/show_bug.cgi?id=13586
Jan 22 2015