On Tuesday, 10 April 2018 at 20:16:18 UTC, Steven Schveighoffer wrote:
e.g. std.array.array is going to pre-allocate an array of the correct length and fill it in, vs. appending each element as it gets them from the range.

Personally, I would store the length because typically a container range is short-lived. It also jives with the container itself which likely has O(1) length.

Thanks, that's what I thought too.

Reply via email to