A container is destructor safe if whether it may store to memory on
destruction only depends on its type parameters.
For example, whether Array<T> may store to memory on destruction depends
only on T.
If T is an Int we know the Array<Int> does not store to memory during
destruction. If T is an arbitrary class Array<MemoryUnsafeDestructorClass>
then the compiler will deduce may store to memory on destruction because
MemoryUnsafeDestructorClass's destructor may store to memory on destruction.
A container is destructor safe if whether it may store to memory on destruction only depends on its type parameters. For example, whether
Array<T>
may store to memory on destruction depends only onT
. IfT
is anInt
we know theArray<Int>
does not store to memory during destruction. IfT
is an arbitrary classArray<MemoryUnsafeDestructorClass>
then the compiler will deduce may store to memory on destruction becauseMemoryUnsafeDestructorClass
's destructor may store to memory on destruction.