Re: [webkit-dev] Initializing member variables

2024-09-19 Thread Jean-Yves Avenard via webkit-dev
> On 20 Sep 2024, at 7:55 AM, Ryosuke Niwa via webkit-dev > wrote: > > > Should we do: > > struct Foo { > int bar = 0; > } > > Or > > struct Foo { > int bar { 0 }; > } > > We do both at the moment. > > - R. Niwa I think `int bar = 0` reads better. I only ever see (and use) { }

Re: [webkit-dev] Initializing member variables

2024-09-19 Thread Timothy Hatcher via webkit-dev
+1 for { }. — Timothy Hatcher > On Sep 19, 2024, at 2:55 PM, Ryosuke Niwa via webkit-dev > wrote: > > > Should we do: > > struct Foo { > int bar = 0; > } > > Or > > struct Foo { > int bar { 0 }; > } > > We do both at the moment. > > - R. Niwa > >

Re: [webkit-dev] Initializing member variables

2024-09-19 Thread Chris Dumez via webkit-dev
No strong feelings but I have a slight preference for `{ }` initialization since it disallows narrowing conversions and works with types that do not have a declared constructor. So if we have to align in one direction, it would be my preference. Chris. > On Sep 19, 2024, at 2:55 PM, Ryosuke Niw

[webkit-dev] Initializing member variables

2024-09-19 Thread Ryosuke Niwa via webkit-dev
Should we do: struct Foo { int bar = 0; } Or struct Foo { int bar { 0 }; } We do both at the moment. - R. Niwa ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev