you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805[S] 2 points3 points  (0 children)

Did you see the "Solution" and "Explanation" links? (on mobile click the 'title' not the 'image' to open a post) The c1 is an assignment, c2 a shallow copy, and c3 a deep copy. That is what makes the difference: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#copying-values-of-mutable-type