|
-
August 2nd, 2012, 12:37 PM
#7
Re: delete vector of objects, single objects, dealocate menory
 Originally Posted by LMHmedchem
This is what is happening by doing newSet = dataSet();, more or less?
Yes, except that having tempSet is unnecessary.
 Originally Posted by LMHmedchem
Does my copy constructor need to have a default value for all the member variables?
Your copy constructor? I would expect the copy constructor to copy everything, except in special cases.
 Originally Posted by LMHmedchem
What happens to the string and vector variables if they aren't initialized to a default value.
If you did not initialise them explicitly, they will be default constructed to empty string and empty vector, respectively.
 Originally Posted by LMHmedchem
Will assigning a default constructed object clear and de-alocate that memory?
If you implemented the copy/move assignment operator correctly, or if the compiler generated one will suffice, yes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|