std::array
,我是否保证语法std::array<T, N> x;
将默认初始化数组的所有元素?
编辑:如果不是,请问是否有一种语法适用于所有数组(包括零大小的数组),以将所有元素初始化为它们的默认值?
编辑:在cppreference上,默认构造函数描述如下:(constructor) (implicitly declared) (public member function)
default-constructs or copy-constructs every element of the array
所以答案可能是肯定的。但我想根据标准或未来的标准确保这一点。
T x[N]
语法。 - Rapptz