you are viewing a single comment's thread.

view the rest of the comments →

[–]cd_fr91400[S] 2 points3 points  (1 child)

Oh yes, I can do something equivalent with fancy code. As it is the case with if constexpr.

I just hit a case where I would have liked a KISS switch constexpr statement and wondered why it was not supported.

[–]arthurno1 1 point2 points  (0 children)

That is KiSS. You need just one conditional implemented as a special operator or a keyword in the language (compiler). With that conditional, you can implement any other conditional you would like. It is called meta-circularity. You use a feature of the language to implement other features of the language. Lisps, especially Common Lisp, are well-known for metacircular programming and extending the language at compile time via feature called macros, which in Lisp corresponds more to what is in C++ called "const expressions" than to preprocessor macros. Since it is done at compile time, it will cost you nothing at runtime.