C++20, How Hard Could It Be
Just a note but I&#x27;m fairly certain this is purely from the perspective of Google Chrome, meaning it excludes google3 (Google&#x27;s repo for nearly all Google services). I don&#x27;t know this for a fact but I suspect it&#x27;s the case. I only bring it up because google3 C++ is (or was; it&#x27;s now been years since I&#x27;ve done this directly) a very different beast. It was notionally compliant with recent standards but a very restrictive subset of features were allowed.<p>The C++ standard currently sits at &gt;1800 pages. Looking through these examples, I&#x27;m honestly horrified. The semantics around moving and copying and the many ways you can initialize a variable [1] and how you can mess that up so it&#x27;s actually a copy instead of a move is just mind-bending.<p>Can we also talk about how in 2022 we&#x27;re still talking about and getting wrong const-correctness? I guess we&#x27;re going ever further now because this presentation touches on <i>constexpr correctness</i> (as in const vs constexpr).<p>Another thought: problems like comparisons between base and derived problems shouldn&#x27;t even be problems (IMHO) because you&#x27;ve already messed up by wanting that behaviour.<p>The change about not doing arithmetic on enum values is a good one but pretty late.<p>TIL this is a valid way to cast:<p><pre><code>    size_t{expanded_size}
</code></pre>
[1]: <a href="https:&#x2F;&#x2F;en.cppreference.com&#x2F;w&#x2F;cpp&#x2F;language&#x2F;initialization" rel="nofollow">https:&#x2F;&#x2F;en.cppreference.com&#x2F;w&#x2F;cpp&#x2F;language&#x2F;initialization</a>