J
Jeff Schwab
The latest GCC (4.2.3) gives a warning if a tr1::array is initialized
with the traditional syntax:
#include <iostream>
#include <tr1/array>
int main() {
std::tr1::array<int, 35> a = { 0 };
std::cout << a[4] << '\n';
}
g++ -ansi -pedantic -Wall main.cc -o main
main.cc: In function 'int main()':
main.cc:5: warning: missing braces around initializer for 'int [35]'
Is this the expected behavior? What's the short, static way to
initialize a tr1::array of arbitrary size?
with the traditional syntax:
#include <iostream>
#include <tr1/array>
int main() {
std::tr1::array<int, 35> a = { 0 };
std::cout << a[4] << '\n';
}
g++ -ansi -pedantic -Wall main.cc -o main
main.cc: In function 'int main()':
main.cc:5: warning: missing braces around initializer for 'int [35]'
Is this the expected behavior? What's the short, static way to
initialize a tr1::array of arbitrary size?