| ▲ | jjmarr 20 hours ago | |
The serious answer is it's the ultra-rare aggregate initialization constructor. https://en.cppreference.com/cpp/language/aggregate_initializ... Generally, when you're doing the
pattern, it's because Foo is a struct with only public members and no constructor used for passing data around. e.g.
When it's that simple rather than type out:
You'd type:
Congrats the code is shorter! | ||
| ▲ | quietbritishjim 13 hours ago | parent [-] | |
It's only rare because it's relatively recent. I expect it to become more widely used because it can be used for simulating named parameters:
They have to be in the correct order though: | ||