Hi,
I want to use an ArrayList to own some mutable struct items. So I create the list like this, for example:
var entities = std.ArrayList(Entity).initCapacity(alloc, 10);
Then I append struct literal:
entities.append(alloc, .{...});
But when I try to get an item, I get a *const Entity:
const e = entities.items[0]
I would like to get a *Entity instead, so that I can mutate it. How can I do that? I suppose that I can make a ArrayList(&Entity) instead, but it made more sense to me to have the ArrayList own the structs so that I don’t have to manage memory twice.
Thanks!