C++ Logo


Advanced search

Re: [std-proposals] Disable assignment to an rvalue

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sat, 15 Oct 2022 09:39:12 -0400
On Sat, Oct 15, 2022 at 7:01 AM blacktea hamburger via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> I agree it would be too disruptive. But there is no "forever", for example, C++17/20 removed a lot of old facilities like auto_ptr. What's wrong with removing some old facility if there's a suitable replacement, and it's been long enough?

You haven't proved that this is like `auto_ptr` though (which is a
type with a copy constructor that actively lies to you). You cannot
make proxy iterators without this functionality. You have proposed
nothing to replace it.

It's easy enough to delete the rvalue-reference version of the
assignment operator if that's what you want for your type. Why should
this be forced onto others?

Received on 2022-10-15 13:40:41