News for hackers. Stuff that matters.
Re:C++17 constexpr everything, or as much as the compiler can by beeforpork on Thursday December 28, 2017 @01:59PM (#16024034)
This is exactly why I don't like C++: it is just too complicated, and it encourages to write complicated code, usually opaque boilerplate template hacks for what would seem a simple concept. This is difficult to read, review, understand, and hence error-prone. No, not only error-prone, but bug-encouraging.

BTW, you can also enforce compile time evaluation like this:

   enum { aux1 = X };
   use(aux1);
But that's two lines, I know. And, of course, it is still a hack ('enum'? What?).
Re:C++17 constexpr everything, or as much as the compiler can by ben-schaaf on Thursday December 28, 2017 @02:31PM (#16024251)
Interestingly D actually used `enum` to define compile time values (as opposed to `alias` which is used for types). If you want a compile time value you can do this:

    enum aux1 = X;