Re:What can C++ do for embedded systems developers? [video]
by bstamour on Monday September 24, 2018 @11:59AM
(#18058778)
It's an example of uniform initialization syntax that was brought into the language in C++11. It simplifies some things (no narrowing conversions allowed) but also complicates things (if any constructor takes in an initialize-list, it gets priority). In this case, the code is constructing an object of type weekday from an expression that represents that particular date.
Re:What can C++ do for embedded systems developers? [video]
by Game_Ender on Monday September 24, 2018 @12:09PM
(#18058868)
It's "aggregate initialization" [0]
struct S {
int x;
struct Foo {
int i;
int j;
int a[3];
} b;
};
S s1 = { 1, { 2, 3, {4, 5, 6} } };
0 - https://en.cppreference.com/w/cpp/language/aggregate_initial...
Re:What can C++ do for embedded systems developers? [video]
by planteen on Monday September 24, 2018 @03:20PM
(#18060560)
I don't think that is what is going on, this is invoking the constructor for the weekday class with the "modern" uniform initilization syntax. This solves the old C++ most vexing parse problem.
https://en.wikipedia.org/wiki/Most_vexing_parse
It seems like this is the C++ class in question: https://howardhinnant.github.io/date/iso_week.html
Code in question was: