Is there a reason for zero sized std::array in C++11?
问题 Consider the following piece of code, which is perfectly acceptable by a C++11 compiler: #include <array> #include <iostream> auto main() -> int { std::array<double, 0> A; for(auto i : A) std::cout << i << std::endl; return 0; } According to the standard § 23.3.2.8 [ Zero sized arrays ]: 1 Array shall provide support for the special case N == 0 . 2 In the case that N == 0 , begin() == end() == unique value. The return value of data() is unspecified. 3 The effect of calling front() or back() for