On 4/13/18 9:37 AM, Emilio Cobos Álvarez wrote:
Would people agree to use:

  , mIsRootDefined { false }

Instead of:

  , mIsRootDefined{ false }

So my take is that we should not use braced initializer syntax in constructor initializer lists. The reason for that is that it makes it much harder to scan for where the constructor body starts. Doubly so when ifdefs in the initializer list are involved. Triply so when someone writes it as:

  explicit TTextAttr()
    , mIsRootDefined
  {
    false
  }
#ifdef SOMETHING
#endif
  {
  }

which is what clang-format did in some of the cases in the patch for bug 525063.

In particular, I think this should have just used:

  , mIsRootDefined(false)

I don't have a strong opinion about the one space when we do use the braced initializer syntax. But we should make sure we don't end up with the above monstrosity where it looks like the ctor body.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to