Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4637: An extra scoped_array(n) constructor, please!
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-03 15:06:36
#4637: An extra scoped_array(n) constructor, please!
-------------------------------+--------------------------------------------
Reporter: niels_dekker | Owner: pdimov
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: smart_ptr
Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by Olaf van der Spek <olafvdspek@â¦>):
Replying to [comment:2 niels_dekker]:
> Hoi Olaf,
>
> Thanks for your feedback. I prefer to have the elements value-
initialized by such a scoped_array(n) constructor.
The difference only applies to types without constructors (AFAIK).
> That's also consistent with the interface of std::vector:
>
> {{{
> // All 'n' elements value-initialized:
> boost::scoped_array<my_type> a(n);
> std::vector<my_type> v(n);
> }}}
>
> People who really need to have uninitialized elements can still use the
old (verbose) syntax, of course...
That argument applies to not initializing as well.
I can't remember ever using new T[]() actually. What use cases do you have
for it?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4637#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC