There are a few C++-isms which vary widely across the tree and I'd like to clarify before we start any major refactorings.

1) Bracing of method bodies in a C++ class declaration

Currently, C++ method bodies inline within a class declaration are documented to start on the next line, e.g.

class B
{
public:
  void Method()
  {
     // Inline body brace is on the next line, column 2
  }
};

Mozilla code widely puts the opening bracde of inline bodies such as this on the end of the declaration line, and I want to make sure we're in agreement to fix this.

2) indentation of visibility within a class declaration

In the above example, "public" is at the same indentation level as the class. This is common in new code, but I want to call it out.

3) placement of the colon and commas for C++ member initializers

MyClass::MyClass()
  : mMember1(foo)
  , mMember2(foo)
{
  // function body
}

Existing usage is all over the place. I personally have found this style to produce the least number of merge conflicts when applying patches to these kinds of methods, but again I want to make sure we're in agreement.

--BDS

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

Reply via email to