45 ms·
The macro should be called IS_CONST(), not C()
by rurban 2y ago
The macro should be called IS_CONST(), not C()
- immibis 2y agoTo determine if an expression is constant in C, one must determine if an expression in C is constant.
- atiedebee 2y agoI agree, but for a blog post it is more concise (IS_CONST or anything that is long would take up a lot more screen real estate on my phone).
- mrgriffin 2y agoWould you expect IS_CONST to evaluate to the constant? With a name like that I would expect it to evaluate to true/false. C here is asserting that the value inside is a constant and then evaluating to that constant.
- rurban 2y agoUh, you are right. C is the right name. It throws. I mixed it up with a similar compile-time constness check in some of my libraries, where I decided if const of not. gcc throws, only clang could give me a proper answer.