Is there a fast way to to make an exact replica of an exisitng object in C++?
For example I have a default constructor that left most variables uninitialized and those variables are to be set later in the process. Then I want to make a exact copy of that object with all the data already initialized.
I heard there is a copy constructor in c++ but I'm not sure how to use it nor do I know if it fits my situation. Is there a convenient way of doing this other than copying all data manually?
EDIT: I have lots of user-defined type in this object (graphs, etc complicated stuff)