C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Appending a string to itself

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Fri, 21 Jul 2023 23:11:29 +0300
On Fri, 21 Jul 2023 at 23:02, Jonathan Wakely <cxx_at_[hidden]> wrote:
>> So, the spec could perhaps use some clarity improvements,
>
>
> The standard is not a tutorial ;-)

That doesn't mean it couldn't have a note (perhaps in the preamble of
string) that says the arguments can overlap the string itself.

> Like Arthur said, the spec says it does a copy of the range. There's no allowance for "unless that range overlaps the string", it just has to do it.

Right. And I squint it in a way where it first says that there is a
requirement that the incoming range is valid
and certainly doesn't then say as the next thing "but as the first
order of business, by all means go ahead and immediately invalidate
it". :)

Received on 2023-07-21 20:11:42