On Friday, 16 October 2015 at 12:43:59 UTC, Meta wrote:
On Friday, 16 October 2015 at 10:38:52 UTC, Shriramana Sharma
wrote:
Is there a particular reason that File.byLine() returns char[]
and not string i.e. immutable(char)[]? Is it just to avoid
being overly restrictive? It seems that having to .idup it is
inefficient...
byLine reuses an internal buffer for each line which gets
overwritten each iteration. The fact that it returns char
instead of string is meant to signal this to the user, to tell
them that the value they're getting back is mutable and subject
to change.
Sorry, but could you explain more simply? I reread all
information, bit can't understand about what buffer you are
talking. And what is "signal"? How it's working?