My question is not about the concept but about the use of these words.
Assuming this case:
int *a=new int[3];
int *b=a; // It is called shallow copy
My question: Is it right to call it a shallow copy? I can not see any shallow copy. int*
is a pointer and it is all about storing some address. So, in the previous example every thing about it was totally copied because the actual data is not part of it. So, why it is called shallow not deep?
For more clarification, I see it like if someone do this:
std::string file_path="C:/file.txt";
std::string another_path=file path;
and called a shallow copy because the file was not really copied.
BTW, are deep/shallow words well-defined in the C++ standard?