Why does File.byLine() return char[] and not string

Daniel Kozak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 16 03:48:10 PDT 2015


Shriramana Sharma píše v Pá 16. 10. 2015 v 16:08 +0530:
> 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...
> 

You need to do dup or idup anyway. It reuses same buffer, so it is not
immutable.


More information about the Digitalmars-d-learn mailing list