C++ Logo

std-proposals

Advanced search

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

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sun, 26 Oct 2025 10:44:16 -0400
On Sun, Oct 26, 2025 at 9:05 AM organicoman via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
>
>
>
> >How would this even help with the confusion you have?
>
> >This would still call the copy constructor, so >if you're logging in your copy constructor and >copy assignment operator, you'll still see that >some elements in the vector were modified >by copy assignment, and new elements were >initialized by copy construction. So you'll still >see "A::A(const A&)" for your example above!
>
> [ One suggestion is to add 2 new special functions ]...i guess its clear the context is about the proposal not the " confusion"

Isn't resolving "the confusion" the *justification* for adding those
two functions? If not, then what problem will adding those functions
solve?

> >So this doesn't even help with the one thing >that you think it would be useful for.
>
> >So combined with being completely >unimplementable (because in the general >case the compiler can't tell whether >assignment is to an existing object or to raw >memory), this is just a terrible idea that >doesn't even work.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-10-26 14:44:29