Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
constexpr is a keyword that has different meanings, depending on the standard used:
constexpr in the C++98 standard
constexpr is not supported in C++98.
constexpr in the C++0x standard
An constexpr is a keyword for generalized constant expressions. In other words, constexpr indicates that an expression will always return the same values, thus rendering this return value a compile-time constant. The example below shows that such a compile-time constant can be used to indicate an array size:
constexpr int get_size() { return 3; } |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.