Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Compiling check, check condition fails, an error message is output
format:
The static_assert ( "Conditions", "error message");
Examples:
The static_assert (! The sizeof (int) = 4, "the this IS Not 32bit Windows!");
Judging whether int length of 4, if not, then 32bit not compiler environment, fail and print an error message.