In this code, why do b
or b1
not trigger an error or even a warning (with -Wall -Wextra)
Probably it would be initialized with 0s implicitly, but shouldn't this be an error, especially with constexpr
?
constexpr std::array<int, 5> a{1,2,3,4,5};
constexpr std::array<int, 5> b{1,2,3,4}; // no error
constexpr int b1[100]{1,2,3,4}; // no error
// constexpr std::array<int, 5> c{1,2,3,4,5,6}; error 5 vs 6