I use a macro that can be dangerous:
#define REMAINDER(v, size) ((v) & (size -1))
obviously, he suggests that the size is 2.
I would like to make sure the size is really 2, but at compile time. (runtime testing is easy, but NOT what I want).
A sufficient test for me would be that size is always a constant (never variable).
I would use BOOST_STATIC_ASSERT
, but I can’t figure out how to use it for what I need.
source
share