Quote 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.