C++ Logo

std-proposals

Advanced search

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

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sat, 8 Oct 2022 13:43:09 -0400
On Sat, Oct 8, 2022 at 11:38 AM Lee Shallis via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Arthur I disagree, anything of the form "func() = ..." or is just bad
> form

That ship sailed before C++98 was even standardized. `*it =
something;` is functionally equivalent to `it.operator() =
something;`. So it's been a part of C++ since forever. Also,
`vector<bool>` has been a part of C++ since forever. As has
`container::front/back` returning non-`const` references.

You can call it bad form if you like, but it is normal C++. I highly
doubt the committee is going to break the entirety of the standard
library iterator and container model (not to mention all of the other
code out there that works) because some people believe it is
"confusing to newbies".

Received on 2022-10-08 17:44:26