Initialize array in constructor without using default constructor or assignment

后端 未结 4 406
日久生厌
日久生厌 2021-01-13 03:56

Consider:

struct A {

 A (int);

 A (const A &);
};

struct B {

 A foo [2];

 B (const A & x, const A & y)
 : foo {x, y} /* HERE IS THE PROBLEM          


        
4条回答
提交回复
热议问题