3 ms·
constexpr is Turing complete and it’s only limit is recursion depth of the compiler, which can be changed. And as of C++17/20 some of the weird stuff like not
by unlinked_dll 7y ago
constexpr is Turing complete and it’s only limit is recursion depth of the compiler, which can be changed.
And as of C++17/20 some of the weird stuff like not using conditionals and such isn’t present anymore.
Also if you’re a masochist, the template system is Turing complete.
- thethirdone 7y agoI was not talking about the turing completeness of constexpr. There are only a few contexts in which constexpr functions are guaranteed to be evaluated at compile-time. This contrasts Jai's compile time only functions. Additionally, Jai can perform arbitrary IO at compile-time which is simply not possible with c++. One of the early demos had a program which played a videogame at compile-time.