第一个例子是用静态查询表达式。
一定要记住,在使用静态断言时,检查的表达式在编译时必须是可计算的。
While using static assertions, always remember that the expression being checked must be evaluable at compile time.
在常量表达式,比如枚举型常量、位域的宽度或是静态变量的初始值,是不允许使用在这种声明中的。
Embedded statements are not allowed in constant expressions, such as the value of an enumeration constant, the width of a bit-field, or the initial value of a static variable.
应用推荐