Can a method push! to a Vector that is a field in a struct?

I think the confusion is that the Julia-level Vector is not rebound when push! does something (IIUC). In other words, push! might re-allocate a new contiguous block of memory, but that only changes its internal pointer to that memory, not the Julia-level binding to your Vector.

8 Likes