If, for example, class
is of type MyClass
initialize partition
with:
partition = MyClass[]
or, if you feel to be more explicit,
partition = Vector{MyClass}(undef,0)
But all this should be inside a function, otherwise partition
will be type unstable anyway.