On Wednesday, 31 August 2016 at 23:38:21 UTC, Yuxuan Shui wrote:


OK, this would work for cases like containers. But what if I represent buffered network input as a range (like File.byLine), and I don't want to copy the buffer all the time? Any suggestion on how to do that correctly?

Then the range should be constructed with a slice of the buffer if it's an array or with something pointer-based if it isn't (which requires a bit of bookkeeping). Ranges should be lightweight and should never require copying of the underlying data.

Reply via email to