4 ms·
What is the advantage of your assume macro over regular C11 static_assert / assert? Apologies if it is immediately obvious. And in case anyone else is wonderin
by boomer_joe 6y ago
What is the advantage of your assume macro over regular C11 static_assert / assert? Apologies if it is immediately obvious.
And in case anyone else is wondering, the advantage of that m_max macro is that it evaluates each of its arguments only once.
- saagarjha 6y agoThe types of things that _Static_assert takes is substantially more limited than this construct, as it can only take an "integral constant expression" which is in practice basic integer arithmetic and nothing else. This construct works with more complicated things that are nonetheless known at compile time, such as "asdf"[4] (should be 0).