
On 10/31/2011 05:26 PM, Olaf van der Spek wrote:
On Mon, Oct 31, 2011 at 9:51 PM, Andrey Semashev <andrey.semashev@gmail.com> wrote:
I'm using it, from time to time. Frankly, I'm not sure there's much value in the suggested improvement. Smart pointers are not containers, so there's no need to follow the interface, especially considering ambiguities like boost::scoped_array<unsigned char> A(0); (is 0 a null pointer or a zero size of the array here?). Zero sized arrays are quite valid when dynamically allocated (the allocation result is not NULL in this case), so you can't always initialize the pointer to NULL in this case. Why not? Does the pointer matter if the size is 0? Yes, it matters. You can test a scoped_array to see whether anything is allocated. You can't determine that its size is 0.
If you want to implement this feature, you would have to advertise this as a change in the interface, not just a new feature, because, as people have pointed out, 0 would map to the size constructor rather than the default pointer. -- 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>