4 ms·
c++ has constexpr for this. a constexpr expression will be evaluated at compile time if the result is used in a constant expression (i.e. assignd to an enum con
by lultimouomo 10y ago
c++ has constexpr for this. a constexpr expression will be evaluated at compile time if the result is used in a constant expression (i.e. assignd to an enum constant or a constexpr variable), or an error will be generated if it is not possible to do so (the expression does not fulfill the requirements to be constexpr).