Constexpr in C++
Constexpr is a new keyword for a C++ developer. Normally Const returns constant but in runtime. Constexpr generally is used in front of a function. The function should be able to calculate in compile time. These functions must return void or a primitive or primitive reference.
1 2 3 |
constexpr int myfunc(){ return 1; } |