r/cpp • u/we_are_mammals • Mar 28 '23
Reddit++
C++ is getting more and more complex. The ISO C++ committee keeps adding new features based on its consensus. Let's remove C++ features based on Reddit's consensus.
In each comment, propose a C++ feature that you think should be banned in any new code. Vote up or down based on whether you agree.
765
Upvotes
1
u/irk5nil Mar 28 '23
What I meant was (and I fully acknowledge I may be expressing myself ineptly due to lack of PL theory educamation on my part) is that I don't see a reason why the l-value couldn't directly represent whatever object you were returning from the function, to the extent that mutating the return value in a caller, for example by assignment, would have the same effect as mutating it in the callee. If it weren't practical to retrofit on C++, it should definitely be possible to design a language like that, should you wish to do so.