static assert
suggest changeVersions
[{“Name”:“C++11”,“GroupName”:null},{“Name”:“C++14”,“GroupName”:null},{“Name”:“C++17”,“GroupName”:null}]
Syntax
- static_assert( bool_constexpr, message )
- static_assert( bool_constexpr ) /* Since C++17 */
Parameters
Parameter | Details | —— | —— |bool_constexpr | Expression to check |message | Message to print when bool_constexpr is false |
Remarks
Unlike runtime assertions, static assertions are checked at compile-time and are also enforced when compiling optimized builds.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents