C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Add vector/string resize functions that don't initialize any new storage
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2020-12-23 05:15:49


On Wed, 23 Dec 2020 at 13:05, Nathan James via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> In P1020R1 and subsequently adjusted in P1973R1, we were granted the
> ability to create smart pointers that don't perform initialization on
> types that are trivially default construbible. This results in slightly
> better performance if you plan to initialize the storage afterwards.
>
> It would be nice if this behaviour could be extended to vector and
> basic_string. Following the convention used in P1973R1, I'd suggest:
>
> > void vector::resize_for_overwrite(size_type count);
> > void basic_string::resize_for_overwrite(size_type count);

See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1072r5.html

Yeah, correct, the _overwrite is probably the more likely suffix for
it, but that proposal is on its way,
it was last reviewed by LEWG a month ago. (Yes, I know this proposal
doesn't cover vector any more.)


STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups