
On 10/31/2011 07:19 PM, Olaf van der Spek wrote:
On Mon, Oct 31, 2011 at 11:52 PM, Richard Hadsell <hadsell@blueskystudios.com> wrote:
Yes, it matters. You can test a scoped_array to see whether anything is allocated. You can't determine that its size is 0. Don't you keep the size somewhere else? The array seems kinda useless when you don't know the size. Sure, but it's a lot easier to just test the pointer. You can replace a plain old pointer with a scoped_ptr or scoped_array without changing any code, except where the object or array is allocated and deleted.
If I replaced a pointer to an array with a std::vector, the code would be entirely different, and it would take up more memory. If I had tens of thousands of these pointers (which I do), I would definitely stick with the current scoped_array and adamantly protest any suggestion that would increase the memory footprint (as I once did a while ago). -- Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studioshttp://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560 Follow Blue Sky Studios on Facebook <http://www.facebook.com/BlueSkyStudios> and Twitter <http://twitter.com/#%21/blueskystudios>