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.