We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff0437d commit a75cb4bCopy full SHA for a75cb4b
docs/cpp/initializers.md
@@ -379,9 +379,14 @@ struct MyAggregate{
379
char myChar;
380
};
381
382
+struct MyAggregate2{
383
+ int myInt;
384
+ char myChar = 'Z'; // member-initializer OK in C++14
385
+};
386
+
387
int main() {
388
MyAggregate agg1{ 1, 'c' };
-
389
+ MyAggregate2 agg2{2};
390
cout << "agg1: " << agg1.myChar << ": " << agg1.myInt << endl;
391
cout << "agg2: " << agg2.myChar << ": " << agg2.myInt << endl;
392
@@ -407,7 +412,7 @@ You should see the following output:
407
412
408
413
```Output
409
414
agg1: c: 1
410
-agg2: d: 2
415
+agg2: Z: 2
411
416
myArr1: 1 2 3 4
417
myArr3: 8 9 10 0 0
418
```
0 commit comments