Range returning an array

Ali Çehreli acehreli at yahoo.com
Tue Apr 9 13:30:23 PDT 2013


On 04/09/2013 01:03 PM, Joseph Rushton Wakeling wrote:

 > to return var.dup rather than var from front(), but this is
 > undesirable because it will hit performance in a big way.

Your problem is the exact situation that stdio.ByLine has faced. There, 
the choice has been to use an internal buffer just like your 'var' and 
leave the .dup call to the user for when it is needed.

That choice is faster but sometimes causes bugs.

Ali



More information about the Digitalmars-d-learn mailing list