KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can someone give an example of a situation where a shallow copy is needed? Note that in some situations, shallow copy and deep copy are the same. This can happen when the object has no ownership over any of its subvariables; that is, all subvariables are aggregated . I'd like to see examples where the an object is composed from variables which it owns, and it still is desirable to copy them shallowly. Remark : I don't care in which language the examples are given. I'm asking this question from a C++/Java/C# point of view, although I think copying is a language agnostic concept.
Tags (comma-separated)
Save Edits
Cancel