3 ms·
> if constexpr is incredibly stupid Would you care to elaborate what's wrong with it? When I used it I always felt it was quite straightforward.
by lionkor 6y ago
> if constexpr is incredibly stupid
Would you care to elaborate what's wrong with it? When I used it I always felt it was quite straightforward.
- mhh__ 6y agoD CTFE restricts what you can't do. If I write my own vector type, even with my own malloc (it would have to get it's memory from the GC when running under CTFE for obvious reasons, but still), I can do useful work on it at compile time and then save that result in the data segment of my executable. Constexpr tells you what you can do. It adds huge amounts of bulk to the standard, there is syntax soup everywhere now etc.