For anyone who places braces thus:
void f() {
stuff();
}
How do you prefer to place braces after long initializer lists?
The same way?
Object::Object()
: foo(1)
, bar(2) {
stuff();
}
Or make an exception so you actually see where the init list ends?
Object::Object()
: foo(1)
, bar(2)
{
stuff();
}
Or leave a blank line?
Object::Object()
: foo(1)
, bar(2) {
stuff();
}
Or maybe make a weird hybrid?
Object::Object()
: foo(1)
, bar(2)
{
stuff();
}
Or abuse indentation
Object::Object()
: foo(1)
, bar(2) {
stuff();
}
Object::Object() : foo(1)
, bar(2) {
stuff();
}
In this small example all are pretty but crank a dozen initializers and a moderately long function body and this quickly changes.