I'm keeping track of a node object that I would like to change later (to a different type and hence re-assign it). It's from an element of an array that I later won't have access to.
I can't just keep track of the object and re-assign it because that will just re-assign the variable and not the actual object that's part of the array. I'm basically looking for ref-like semantics but without using methods.
My current workaround is just keeping track of the array the element is a part of and the index the object is at but having two variables just to do this seems kind of messy. Surely there is a better way?