On 4/29/12, Jonathan M Davis <jmdavisp...@gmx.com> wrote: > struct S > { > int field1; > float field2; > string field3; > } > then you can do > > auto s = S(5, 7.2, "hello"); > > The ability to do > > S s = {5, 7.2, "hello"}; > > gains you _nothing_.
That's not really the benefit of those initializers. This is: S[] arr = [{field2 = 1.0}, {field2 = 0.5}]; It's a real benefit when unittesting because it allows me to quickly create variables with some interesting state which I can then test.