Top "Shallow-copy" questions

A shallow copy of an object is a duplicate that may not be fully independent of the original, in the sense that any references / pointers it holds to other objects refer to the same objects that the original's do.

Shallow copy and deep copy in C

I tried googling this but only objected oriented languages pop up as results. From my understanding a shallow copy is …

c deep-copy shallow-copy
JS: Does Object.assign() create deep copy or shallow copy

I just came across this concept of var copy = Object.assign({}, originalObject); which creates a copy of original object into …

javascript object deep-copy shallow-copy
What is the difference between being shallowly and deeply equal? How is this applied to caching?

Found the following in my notes, but I am unable to make sense of it: Primitive type wrapper classes implement …

java caching deep-copy shallow-copy
Can I use memcpy in C++ to copy classes that have no pointers or virtual functions

Say I have a class, something like the following; class MyClass { public: MyClass(); int a,b,c; double x,y,…

c++ performance shallow-copy
Copy object properties: reflection or serialization - which is faster?

I have two objects of the same type and need to copy property values from one object to another. There …

c# serialization deserialization deep-copy shallow-copy
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Error

This error occurs during run time, and I'm not sure what's causing it - the code looks correct to me. #…

c++ class runtime-error deep-copy shallow-copy
When should I pass or return a struct by value?

A struct can be either passed/returned by value or passed/returned by reference (via a pointer) in C. The …

c shallow-copy
How to copy a list in Scala

I want to shallow copy a list in Scala. I wanted to do somehing like: val myList = List("foo", "bar") …

list scala copy shallow-copy
C# Shallow copy Dictionary?

I need to shallow copy a dictionary in c#. For instance: Dictionary<int,int> flags = new Dictionary<…

c# dictionary shallow-copy
Deep Copy Constructor for binary tree

I am trying to create a deep copy of my binary tree data structure in C++. The problem is the …

c++ binary-tree copy-constructor deep-copy shallow-copy