
On 10/26/2011 05:14 PM, Olaf van der Spek wrote:
On Wed, Oct 26, 2011 at 11:02 PM, Ivan Sorokin<vanyacpp@gmail.com> wrote:
Maybe off-topic, but why should one prefer scoped_array to vector? Just curious, I never used it myself. Me neither, but scoped_array can take ownership of an existing array. And it can be used when construction of elements (like int) is unwanted. I expected it to also support release(), but it seems it doesn't. It's lightweight -- its memory footprint is only the pointer. It uses reset() instead of release(). It's just the same as a simple array, but it will always be deleted.
The extra features of std::vector (appending, inserting, removing elements; iterators; size; etc.) make it nothing like scoped_array. -- 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>