Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
类似于标准数组:
int A[] = {1,2,3,4};
我遇到的问题是初始化的 std::array 必须手动匹配初始化元素的大小和数量,这很糟糕。
我知道我可以用初始化列表构建自己的数组并做类似的事情,但它不会是静态数组。我希望 C++11 标准要求它仍然是可能的,但我无法确定语法,如果它是,我在标准中找不到任何东西来确认一种或另一种方式(我永远找不到任何东西标准!)。