Код: Выделить всё
constexpr void f(const int i)
{
constexpr int m = i; // error (i is not a constant expression)
static_assert(i == 42); // error (i is not a constant expression)
std::array arr{}; // error (i is not a constant expression)
}
int main()
{
f(42);
}
Подробнее здесь: https://stackoverflow.com/questions/235 ... expression
Мобильная версия