C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Consistent behavior on Container actions

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 26 Oct 2025 12:35:14 -0700
On Sunday, 26 October 2025 10:04:27 Pacific Daylight Time Jason McKesson via
Std-Proposals wrote:
> > Local reasoning...
> > - I expect copy assignment, then i see mixture of copy
> > assignment/construction...why?
> It is wrong for you to expect this. Copy assignment and copy
> construction are functionally doing the same thing. It should not
> matter to you which is happening, so your expectations are misplaced.

Let's try an analogy.

I have a container of many niches that can contain fruit. The first three
currently contain an apple. I want to place five oranges in the container.

For the first three niches, the operation is "replace apple with orange".

Tell me how I can perform the same operation in the empty niches, for the next
two oranges.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center Group

Received on 2025-10-26 19:35:25