Re:C23: A Slightly Better C
by akira2501 on Sunday January 21, 2024 @04:11PM
(#39083103)
> that generate a ton of invisible code under your feet
Which is bad enough but there are plenty of cases where it may do this, or it may generate short obvious sequences of code, depending on more factors like compiler flags than you can easily observe while examining the line of code in question.
Hence the "as-if" rule, which helpfully applies in a lot of places, but not all, like return value optimization. I never felt like taking the time to build the kind of C++ confidence one must require to wield it correctly.
Which is bad enough but there are plenty of cases where it may do this, or it may generate short obvious sequences of code, depending on more factors like compiler flags than you can easily observe while examining the line of code in question.
Hence the "as-if" rule, which helpfully applies in a lot of places, but not all, like return value optimization. I never felt like taking the time to build the kind of C++ confidence one must require to wield it correctly.