Is there any mechanism by which a value could be guaranteed not to move in memory? In particular, I want to have an init function return a structure containing references to itself.
Right now the initializer function receives the structure by pointer, which means a list is impossible to declare by-value. This is pretty problematic, especially since that structure is an intrusive linked list that will need to be a field of its elements (and no, I can't use the std one, it can't do some things I need).
var list: List;
list.init();
var obj: OtherStructure = .{
// initializing the object's fields...
};
obj.listNode.init(); // Must do that, or else the list breaks
Yo