|
-
July 13th, 2010, 12:51 PM
#15
Re: delete[] mechanics
Ah yes, the copy assignment operator, I always forget to write that one.
Code:
array & operator = (const array & orig){
internal = orig.internal;
++internal -> refcount;
return *this;
}
Yes, my original code was using a shallow copy, but then I realized how dumb that was, seeing as the destructor deleted the array and anything that had been shallow copied would become invalid.
Tags for this Thread
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
|