我试图通过初始化列表来初始化一个二维std::array,但编译器告诉我有太多的初始值。
例如:
例如:
std::array<std::array<int, 2>, 2> shape = { {1, 1},
{1, 1} };
编译器错误: 错误:对于'std::array<std::array<int, 2ul>, 2ul>'
有太多的初始化程序
但显然没有太多。我做错了什么吗?
std::array<std::array<int, 2>, 2> shape = {{ {{1, 1}}, {{1, 1}} }};
。呃。。。 - Jeff