C++ Logo

std-proposals

Advanced search

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

From: Peter C++ <peter.cpp_at_[hidden]>
Date: Mon, 17 Oct 2022 20:57:29 +0200
the MISRA C++ guideline is not opposing rule of zero. only when you define your own copy or move assignment for manager types the rule kicks in. unfortunately the language defaults were not adapted to use lvalue ref qualification for C++11 (as given as a motivation in a 2004 paper for the feature)

regards
Peter

Sent from Peter Sommerlad's iPad
+41 79 432 23 32

> On 17 Oct 2022, at 18:43, Arthur O'Dwyer via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> FWIW, I think the extra `&` (multiplied by all the types in your program) is just noise. Also, what, this means you can't use the Rule of Zero anymore because it won't append that superfluous `&`? That's much more noise, and potential for introducing errors accidentally. So, I disagreed with MISRA-C++'s proposed guideline there.

Received on 2022-10-17 18:57:34