toString refactor in druntime

Jakob Ovrum via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 31 15:13:29 PDT 2014


On Friday, 31 October 2014 at 19:09:28 UTC, H. S. Teoh via 
Digitalmars-d wrote:
> Besides, the sink version basically allows encapsulation of an 
> output
> range -- instead of calling x.toString(outputRange) you just 
> write:
>
> 	x.toString((const(char)[] data) { outputRange.put(data); });

In recent compiler versions we can just write:

     x.toString(data => outputRange.put(data));


More information about the Digitalmars-d mailing list