Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Copying Field3Ds should be cheap, so copy any parallel slices from the rhs
This modifies the implementation from #1803 by just copying the parallel slice vectors themselves, rather than copying the fields in them. This removes the need to keep track of a separate bool for whether or not to copy the parallel slices of parallel slices.
I think the bool was originally there to avoid an infinite recursion when creating parallel slices using the identity transform, which just copies the field into its own slices, relying on copy-on-write to make this cheap. This implementation makes an initial copy and ensures that that doesn't have parallel slices, and uses that copy to fill in the original's parallel slices. This should all be cheap thanks to copy-on-write.
Also adds a move assignment operator to Field3D to make this even cheaper by moving the parallel slice vectors.