On Wednesday, June 6, 2018 at 5:21:05 AM UTC+3, gsqu...@mozilla.com wrote: > On Wednesday, June 6, 2018 at 5:35:59 AM UTC+10, Boris Zbarsky wrote: > > On 6/5/18 3:10 PM, Emilio Cobos Álvarez wrote: > > > I personally would prefer one space at each side when using braces: > > > > > > , mFoo { 0 } > > > > I think the reason people tend to think of this as not wanting spaces is > > that they are thinking of it as a constructor call. The parentheses > > syntax for initializer lists helps think of things that way, of course. > > [...] > > -Boris > > I also prefer `m{ 0 }`. > > `m(0)` (direct initialization) and `m{ 0 }` (list initialization) are really > different operations, and may in fact call different constructors -- E.g., > the latter will prefer constructors that take an std::initializer_list. > So I think it is important to emphasize the difference, especially for > reviewers to be able to pick on that difference. > > g.
I completely agree with your point regarding the {} list initialize, and also the rest of opinions posted here. If what Eric wrote is the common ground here, I will be more than happy to update the the coding style doc. I think we’ve started to use “{ }” list initialiser on a mass scale since it was easier to implement the auto-fix for bug 525063. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform