writeln and ~

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 14 09:48:19 PST 2017


On Saturday, 14 January 2017 at 17:42:05 UTC, Ignacious wrote:
> Why can't string concatenation automatically try to convert the 
> arguments? Is there any reason this is bad behavior?

You'd be liable to write buggy stuff like appending the wrong 
kind of array since the auto conversion was wrong.

> How bout then having writeln parse the arguments as a 
> string(take an alias or something first) and then automatically 
> convert them?

writeln already knows how to convert. There's also a 
std.conv.text function that returns the string instead of 
printing it.

http://dpldocs.info/experimental-docs/std.conv.text.html


More information about the Digitalmars-d-learn mailing list