Merge lp://qastaging/~afrantzis/mir/initializer-list-style into lp://qastaging/mir
Proposed by
Alexandros Frantzis
Status: | Rejected |
---|---|
Rejected by: | Alan Griffiths |
Proposed branch: | lp://qastaging/~afrantzis/mir/initializer-list-style |
Merge into: | lp://qastaging/mir |
Diff against target: |
18 lines (+4/-4) 1 file modified
guides/cppguide.xml (+4/-4) |
To merge this branch: | bzr merge lp://qastaging/~afrantzis/mir/initializer-list-style |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Daniel van Vugt | Approve | ||
Alberto Aguirre (community) | Approve | ||
Alan Griffiths | Needs Information | ||
Review via email:
|
Commit message
guides: Change multi-line initializer list style to the one we predominantly use in the code base
Description of the change
guides: Change multi-line initializer list style to the one we predominantly use in the code base
The currently approved style is:
C(int x, int y, int z) :
x{x},
y{y},
z{z}
{
}
$ grep -R ") : *$" src/ include/ examples/ tests/ | wc -l
211
What we predominantly use is:
C(int x, int y, int z)
: x{x},
y{y},
z{z}
{
}
$ grep -R "^ *: " src/ include/ examples/ tests/ | wc -l
412
To post a comment you must log in.
Unmerged revisions
- 2548. By Alexandros Frantzis
-
guides: Change initializer list style to what we predominantly use in the code base
My personal preference is for the style we are predominantly using, because it visually separates the constructor parameter list from the initializer list, which can help in some cases:
===== Approved style =====
class C( :shared_ ptr<int> const& a_pointer, :shared_ ptr<int> const& a_pointer, :shared_ ptr<int> const& a_pointer) : a_pointer} , b_pointer} , c_pointer}
std:
std:
std:
a_pointer{
b_pointer{
c_pointer{
{
}
===== Predominant style =====
class C( :shared_ ptr<int> const& a_pointer, :shared_ ptr<int> const& a_pointer, :shared_ ptr<int> const& a_pointer) a_pointer} , pointer{ b_pointer} , pointer{ c_pointer}
std:
std:
std:
: a_pointer{
b_
c_
{
}
In case the comment formatting is messed up, take a look at http:// paste.ubuntu. com/10990296/
The downside of the predominant style is that it introduces a special formatting rule (normally we would break the line after a special symbol, not before it).