May 2017
Intermediate to advanced
590 pages
17h 18m
English
static_assert is basically a declaration, but it does not introduce a new name. These declarations have the following form:
static_assert(condition, message);
The condition must be convertible to a Boolean value at compile time, and the message must be a string literal. As of C++17, the message is optional.
When the condition in a static_assert declaration evaluates to true, nothing happens. When the condition evaluates to false, the compiler generates an error that contains the specified message, if any.
Read now
Unlock full access