_Static_assert ( expression , message ) | (since C11) |
expression | - | any integer constant expression |
message | - | any string literal |
This keyword is also available as convenience macro static_assert
, available in the header <assert.h>
.
The constant expression is evaluated at compile time and compared to zero. If it compares equal to zero, a compile-time error occurs and the compiler must display message as part of the error message (except that characters not in basic source character set aren't required to be displayed).
Otherwise, if expression does not equal zero, nothing happens; no code is emitted.
C++ documentation for Static Assertion |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/c/language/static_assert