1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
class Cvector {
public:
int x,y;
Cvector () {};
Cvector (int a,int b) : x(a), y(b) {}
};
class Cvector2 {
Cvector foo1 {3,10}; // braced-init-list, fine
Cvector foo2 = Cvector(1,1) ; // = initializer-clause, fine
Cvector foo3 = {5,6} ; // = initializer-clause, fine
Cvector bar1[3] { {1,2}, {1,3}, {2,3} } ; // fine
Cvector bar2[3] = { {1,2}, {1,3}, {2,3} } ; // fine
Cvector bar3[3] = { Cvector{1,2}, Cvector{1,3}, Cvector{2,3} } ; // fine
Cvector bar4[3] = { Cvector(1,2), Cvector(1,3), Cvector(2,3) } ; // fine
};
|