|
-
July 13th, 2010, 01:31 PM
#18
Re: delete[] mechanics
 Originally Posted by ninja9578
The point of my code WAS to track the size.
I'm sure that boost:shared_array is very similar to the code that I just wrote.
As you have posted your disclaimer, you know your code is more likely to have bugs (and it does, e.g., the copy assignment operator is not correctly implemented) than boost::shared_array 
Using a boost::shared_array<T> member with a size_t member for the size will probably eliminate most of that. You can afford to have shallow copying for the size, so you can ignore the copy constructor, copy assignment operator and destructor, and these I think are the most likely places for bugs where reference counting is concerned.
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
|