Jive reference manual
|
Checks a boolean condition at compile-time. More...
#include <jem/base/utilities.h>
The CompileTimeCheck
class enables one to check whether a boolean condition is true at compile-time, just as the traditional assert
macro is used to verify a boolean condition at run-time. The CompileTimeCheck
class has no members, but its specialization for template arguments evaluating to true
has the static member check()
, an inline member function that is empty.
The following example shows how to use this class:
This example will only compile if the constant N
is larger than zero. If it is not, the compiler will not be able to find the member function check
, and the code will not compile.