70. static_assert

Question.3

A circular buffer requires a power-of-two size for bitmask wrapping. A developer validates this:

constexpr int BUF_SIZE = 64;
static_assert((BUF_SIZE & (BUF_SIZE-1)) == 0, "Buffer must be power of 2");

A colleague changes BUF_SIZE to 100. What happens?

Need Help? Refer to the Quick Guide below

Select Answer