Bisqwit

In C++, the “constexpr” keyword is used to denote…

3 months ago | [YT] | 34



@antoniogarest7516

How about consteval? 🧐

3 months ago | 2

@binary132

None of the above, a constexpr function only may be used in constant-evaluated contexts. In fact, if I’m not mistaken, constexpr functions can be defined which cannot ever actually be constant-evaluated. That’s why consteval is important.

3 months ago | 3

@ZomB1986

YIL (Yesterday I Learned) if you make a function constexpr, you have to move the definition to the header file. I also learned that you have to put as many definitions out of the header file as possible to decrease compile time. Since constexpr is most useful for static utility functions, and utility functions are at their best if they're used everywhere, I'm at a dilemma.

3 months ago (edited) | 0

@Logicatube

What is better to use? Define or Constexpr?

3 months ago | 0