©
This document usesPHP Chinese website manualRelease
在头文件 |
|
|
---|---|---|
#define static_assert _Static_assert |
|
|
此便利宏扩展为关键字_Static_assert。
#includeint main(void){ static_assert(2 + 2 == 4, "2+2 isn't 4"); // well-formed static_assert(sizeof(int) < sizeof(char), "this program requires that int is less than char"); // compile-time error}
C11标准(ISO/IEC 9899:2011):
7.2/3诊断
| 静态声明的C ++文档
|:----|