我正在尝试在另一个类的构造函数中初始化一个 std::array 对象。似乎聚合初始化应该在这里工作,但我想不出合适的语法。我该怎么做呢?
class A {
const int a;
public:
A(int an_int) : a(an_int) {}
};
class B {
std::array<A,3> stuff;
public:
B() :
stuff({1,2,3}) // << How do I do this?
{}
};
int main() {
B b;
return 0;
}