Question 9
Back to Exercise
When is static_assert(sizeof(long) == 8, "need 64-bit long"); checked?
- A At run time, every time it is reached
- B At compile time – a false condition is a compile error Correct
- C Only in debug builds
- D At link time
Correct Answer: Option B
The condition must be an integer constant expression. A failing static_assert stops the build with the message, so wrong assumptions never reach users.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!