Provide an ArrayCopy that can do shallow if possible
Oftentimes you need an array of a specific type. The easiest way to get that if you do not know the type (i.e. through templating) is to use ArrayCopy
to copy to a known array type. However, it is wasteful to do this copy if the array is already of the correct type.
ArrayCopy.h
should provide an alternate function (maybe called ArrayCopyShallowIfPossible
) that will do a shallow copy if the array types match and a deep copy otherwise.