
The current shared_array doesn't keep track of size. This greatly decreases it's usefulness. So I wrote a variant that does: http://pastebin.com/wkdLVqM1
If one thinks of the class as a resource-owning iterator_range, I think a three member (shared_ptr/iterator_range) implementation gives more flexibility (e.g. sub range instances could track resource ownership against the same shared_ptr).
I extended the spirit of Olaf's shared_array2 implementation quite a bit so that it really is a smart resource-managing iterator_range called shared_range. The implementation (with documentation) and tests are up at https://github.com/RhysU/shared_range. I've opted to move resource allocating operation's like Olaf's shared_array2(size_t) constructor into free functions in the spirit of make_shared and allocate_shared. Olaf, I've added your name to the implementation header in shared_range.hpp. Please let me know if that's not okay with you. Any feedback (or edge cases I've missed) greatly appreciated, Rhys