I\'m trying to initialize an int array with everything set at -1.
I tried the following, but it doesn\'t work. It only sets the first value at -1.
in
I had the same question and I found how to do, the documentation give the following example :
std::array a1{ {1, 2, 3} }; // double-braces required in C++11 (not in C++14)
So I just tried :
std::array a1{ {1} }; // double-braces required in C++11 (not in C++14)
And it works all elements have 1 as value. It does not work with the = operator. It is maybe a C++11 issue.