You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wentzell
changed the title
Self-move-assign of array nullifies the storage while keeping the shape the same
Self-move-assign of array nullifies the storage while keeping the layout the same
Feb 16, 2021
Wentzell
changed the title
Self-move-assign of array nullifies the storage while keeping the layout the same
Self-move-assign of array nullifies the storage while keeping the shape the same
Feb 16, 2021
It indeed leaves the array "in a valid but unspecified state"..., in fact in a simple state...
We don't have to protect it I think.
But we could add an assert in handle_heap this !=x in debug mode (NDA_DEBuG) ?
This is to keep track of an open discussion as to how we want to handle self-move-assignment for basic_array.
This calls the defaulted move-assignment
which will trigger a stack-copy of the shape (idx_map), while nullifying the storage (handle). C.f.
In other words the array ends up with null-storage and non-zero shape.
Do we want to protect the handle move-assign for
this == &x
?C.f. also https://ericniebler.com/2017/03/31/post-conditions-on-self-move/
The text was updated successfully, but these errors were encountered: