Follow

@ekaitz_zarraga
You just write your usual code with an extra keyword and it is executed at compile time. How is this in any way bad, or has anything to do with backward compatibility?
Constant expressions have been introduced almost 10 years ago and have been gradually evolving since by popular demand. For most C++ devs this is just an obvious quality of life improvement. If it seems too much for you you can absolutely ignore it, until you naturally arrive at a use case.

@codewiz I must say though it is not really a code generator, or a replacement for code generators. With constexpr/consteval you can only generate objects within the language's type system, you can't generate anything "meta", such as function signatures for example. Also the new consteval in particular has a very niche use case, and I hope it is not overused. constexpr is almost always better.

· · SubwayTooter · 0 · 0 · 0
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.