Question.6
A developer validates a buffer configuration at compile time:
constexpr int BUF_SIZE = 100; static_assert((BUF_SIZE & (BUF_SIZE - 1)) == 0, "Buffer size must be power of 2");
What happens during compilation?
Select Answer
Compiles successfully -- 100 is a power of 2
100
2
Compilation error with the message -- 100 is not a power of 2, and static_assert fires
static_assert
Runtime assertion failure when the program starts
Warning only -- static_assert does not stop compilation