constexpr Function Parameters

The Set-up In C++, this doesn’t work: The compiler complains, quite rightly: Despite the fact that twice_square is a constexpr function, its parameter x is not constexpr. We can’t use it in a static_assert, we can’t pass it to a template, we can’t call an immediate (consteval) function with it. So far, so well known.… Continue reading constexpr Function Parameters

Published
Categorized as C++