| > of what a f up language C++ is/has become I believe this misconception on your part stems from a lack of awareness (or understanding) of C++ design goals as a language. Have a look at this writeup:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p21...
(caveat: not formally adopted) constexpr supports the following goals: * Provide the programmer control over every aspect of performance: Compile-time vs run-time execution is an aspect of performance. * Excellent ergonomic: Using constexpr/consteval improves on earlier mechanisms for achieving compile-time evaluation, such as macros, template meta-programming etc. Those are unwieldy, often difficult to read, and inflexible (without jumping through hoops). constexpr is not. etc. etc. and marginally supports the following goals: * Code should perform predictably: Control over what exactly runs at run-time improves predictability. * Leave no room for a lower level language: While constexpr is neither low nor high as a language feature, one can argue that having it undercuts the potential for, say, a "C + constexpr"-like language, or another lower-level language with a more elaborate macro system. etc. etc. I could go on naming goals constexpr supports, there are lots more. I challenge you to find goals from which it detracts. |
Not only was P2137 "not formally adopted" it was purposefully written so that the committee could say explicitly "No" to these goals. It's in some sense a manifesto for one of the 2022 "C++ successor" languages, Carbon not for C++.
If you want to cite actual goals, you won't get much from WG21, which prefers not to get tied down by having any principles to speak of. Bjarne himself however wrote a book in 1994 "Design & Evolution of C++" which might help you determine some goals.
I don't see constexpr functions in particular as a success. There are too many caveats, it's easy to find C++ programmers who've written what they assume is a constant evaluated expression but it isn't, for one of many reasons their compiler has decided it's runtime evaluated, and the programmer was surprised.