digitalmars.D.learn - Is std.container.array more or less an equivalent of C#'s List<T>?
- A Guy With a Question (7/7) Dec 04 2017 Reading this, the interface seems very similar, but I'm not sure.
- A Guy With a Question (5/12) Dec 04 2017 For clarity (had a typo in the original question). I do not want
- Steven Schveighoffer (8/17) Dec 04 2017 Appending is amortized (IIRC, it doubles the size when it needs more
- Basile B. (5/12) Dec 04 2017 std.Array.Appender
Reading this, the interface seems very similar, but I'm not sure. There's only like a two sentence general description, then it goes on to talk about a boolean specialization... https://dlang.org/phobos/std_container_array.html I'm looking for something that doesn't have to resize every insert/append, but also it's going to be copying the whole array either each time.
Dec 04 2017
On Monday, 4 December 2017 at 16:26:02 UTC, A Guy With a Question wrote:Reading this, the interface seems very similar, but I'm not sure. There's only like a two sentence general description, then it goes on to talk about a boolean specialization... https://dlang.org/phobos/std_container_array.html I'm looking for something that doesn't have to resize every insert/append, but also it's going to be copying the whole array either each time.For clarity (had a typo in the original question). I do not want it copying the entire array every time. I'm looking for something
Dec 04 2017
On 12/4/17 11:26 AM, A Guy With a Question wrote:Reading this, the interface seems very similar, but I'm not sure. There's only like a two sentence general description, then it goes on to talk about a boolean specialization... https://dlang.org/phobos/std_container_array.html I'm looking for something that doesn't have to resize every insert/append, but also it's going to be copying the whole array either each time.Appending is amortized (IIRC, it doubles the size when it needs more space), everything else must copy data. It's an array underneath, but instead of using the GC, it uses C heap functions. It isn't really any different than a D builtin array, but has some better performance characteristics in some cases. It's also not safe to keep pointers to elements if it reallocs. -Steve
Dec 04 2017
On Monday, 4 December 2017 at 16:26:02 UTC, A Guy With a Question wrote:Reading this, the interface seems very similar, but I'm not sure. There's only like a two sentence general description, then it goes on to talk about a boolean specialization... https://dlang.org/phobos/std_container_array.html I'm looking for something that doesn't have to resize every insert/append, but also it's going to be copying the whole array either each time.std.Array.Appender or iz.containers.Array
Dec 04 2017