When an immutable
has a Vector
field, is it allowed to modify that using !
functions (like these)? My understanding is that even if the underlying memory is remapped (eg because the vector grows or shrinks too much), it is still the “same” vector, so it is OK. MWE:
immutable Foo
v::Vector
end
foo = Foo([])
push!(foo.v, 1)