Top "Copy-constructor" questions

A copy constructor is a constructor that creates a new object that is a clone of an existing object.

Proper way to deep copy with copy constructor instead of Object.clone

I have some code that performs a deep copy using Object.clone, but I'm trying to rewrite it using the …

java clone copy-constructor deep-copy cloneable
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
How do I make a copy of java.util.Properties object?

I have the following field and constructor: private final Properties properties; public PropertiesExpander(Properties properties) { this.properties = properties; } The good …

java collections properties copy copy-constructor
Why does the implicit copy constructor calls the base class copy constructor and the defined copy constructor doesn't?

Consider a class hierarchy where A is the base class and B derives from A. If the copy constructor is …

c++ language-design copy-constructor
Copying derived entities using only base class pointers, (without exhaustive testing!) - C++

Given a base class that is inherited by plethora of derived classes, and a program structure that requires you manage …

c++ inheritance pointers copy-constructor
copy constructor is implicitly deleted because the default definition would be ill-formed

I've got a class A (from a library over which I have no control) with a private copy constructor and …

c++ clone copy-constructor private-constructor
Why is the copy constructor called when we return an object from a method by value

why copy constructor is called when we return an object from a method by value. please see my below code …

c++ copy-constructor return-by-value
C++: Deep copying a Base class pointer

I searched around and seems in order to perform this I need to change my Base class and want to …

c++ inheritance copy-constructor deep-copy
Is there a decent way of creating a copy constructor in python?

I realize questions quite similar to this have been asked, though not exactly this way. I'd like to have an …

python copy-constructor deep-copy
Is is possible to use std::map in C++ with a class without any copy operator?

I'm using a Class (Object) that doesn't have any copy operator : it basically cannot be copied right now. I have …

c++ constructor copy-constructor stdmap