C++ Logo

std-proposals

Advanced search

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

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Sat, 08 Oct 2022 17:51:51 +0100
Hi,


On 8 October 2022 16:37:50 BST, Lee Shallis via Std-Proposals <std-proposals_at_[hidden]> wrote:
>Arthur I disagree, anything of the form "func() = ..." or is just bad
>form & absolutely confusing to newbies, even if it's syntactically
>correct it's bad practice and you know it. Better to depreciate &
>declare it an error than to allow that practice to continue. The
>result of a function should ALWAYS be an rvalue to avoid confusion and
>poorly thought out code.

Are you arguing that absolutely no function should return by lvalue reference?

Cheers,
Lénárd

Received on 2022-10-08 16:51:55