On Thursday, 17 December 2020 at 16:46:47 UTC, Q. Schroll wrote:
On Thursday, 17 December 2020 at 16:11:37 UTC, IGotD- wrote:
It's common using arrays for buffering

Outside of CTFE, use an Appender.¹ Unless you're having a const/immutable element type, Appender can shrink and reuse space.² If you have, reallocation is necessary anyway not to break const/immutable' guarantees.

¹ https://dlang.org/phobos/std_array.html#appender
² https://dlang.org/phobos/std_array.html#.Appender.clear

Thank you, I will try this one out.

Reply via email to