C++ Logo

std-proposals

Advanced search

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

From: blacktea hamburger <greenteahamburger_at_[hidden]>
Date: Sun, 16 Oct 2022 08:41:50 +0800
I've said that an easy way to allow rvalue assignment and `as_lvalue` can
be provided, and by default it is not allowed.

On Sat, Oct 15, 2022 at 9:40 PM Jason McKesson via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> 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?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-10-16 00:42:22