C++ has, buried within it, no less than four "general-purpose" programming languages. We have regular run-time C++, constexpr, templates, and macros. This presentation will cover a new proposal for C++: constexpr Function Parameters. It aims to make C++ a much more powerful language by helping to merge constexpr programming into regular C++. This will allow writing code that is faster, is easier and more natural to use, is terser, and catches errors at compile time. This new language feature would provide a way to annotate a function parameter as constexpr, letting you do things like overload on whether something is a compile-time constant, or pass constants to things that cannot have template parameters (like constructors and operators).
This presentation will focus on the principles used in the design of C++ and in this feature. From those principles, we will go into the details of the proposal. This presentation will briefly cover what constexpr is used for as of C++20 (the version of C++ that is being finalized now and will be officially 'released' in 2020). The proposal for constexpr function parameters is targeted at C++23 ('released' in 2023). The presentation will briefly cover the standardization process and timeline.
Recommended background (none of these are necessary, but they are helpful):
* No Shadow Worlds: https://probablydance.com/2015/02/16/ideas-for-a-programming-language-part-3-no-shadow-worlds/
* Inventing on Principle: https://vimeo.com/36579366
* constexpr: Introduction (as of C++11 and C++14) https://www.youtube.com/watch?v=fZjYCQ8dzTc
The proposal paper can be found at
https://github.com/davidstone/isocpp/blob/master/constexpr-parameters.md