Nov 26, 2011 at 9:12pm Nov 26, 2011 at 9:12pm UTC
This is wrong delete [] &items;
The vector will clean up itself in the destructor so no need to do anything. Only delete
what you create with new
.
Last edited on Nov 26, 2011 at 9:16pm Nov 26, 2011 at 9:16pm UTC
Nov 26, 2011 at 9:22pm Nov 26, 2011 at 9:22pm UTC
Thanks, I appreciate it. So is there even a reason to have a ~Set()
function in this class?
Nov 26, 2011 at 9:24pm Nov 26, 2011 at 9:24pm UTC
A destructor will be made; if not by you, by the compiler. If you've got nothing special you want to do in it, don't bother making one yourself.
Nov 26, 2011 at 9:28pm Nov 26, 2011 at 9:28pm UTC
Understood. Thanks for the help, everyone.