[webkit-dev] Initializing member variables

Jean-Yves Avenard jean-yves.avenard at apple.com
Thu Sep 19 16:12:37 PDT 2024



> On 20 Sep 2024, at 7:55 AM, Ryosuke Niwa via webkit-dev <webkit-dev at lists.webkit.org> 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) { } and I thought that was the proper coding style.

I’m surprised it’s not in our guidelines. 

Jean-Yves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20240920/66a39918/attachment.htm>


More information about the webkit-dev mailing list