Liste des Groupes | Revenir à cl c |
Am 12.10.2024 um 15:23 schrieb Thiago Adams:If you are afraid your constant is not constant expression put a static_assert. Then remove.
With constexpr you could enforce that the expression you assign is
compile-time evaluated. That's while constexpr would make sense.This is already the default in C for file scope variables ...They must be optimized away by the compiler and the linker, constexpr
not. And most compile time constants that are constexpr'd in C++ are
local variables. So constexpr makes sense at least for local variables.
Les messages affichés proviennent d'usenet.