Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
An static_assert is a keyword that can be used, depending on the standard used:
static_assert in the C++98 standard
static_assert in the C++0x standard
static_assert in the C++98 standard
static_assert is not supported in C++98:
int main() |
Compiler output:
/MyFolder/main.cpp:3: warning: identifier 'static_assert' will become a keyword in C++0x |
BOOST_STATIC_ASSERT does already allow for compile-time assertions in C++98.
static_assert in the C++0x standard
static_assert is a keyword to perform assertions during compile-time.
int main() |
Compiler output:
/MyFolder/main.cpp:: In function 'int main()': |
Technical note: the code shown is compiled successfully using the G++ 4.4.5 compiler, which is supplied with the Qt Creator 2.0.0 IDE.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.