Different styles for merging short functions containing at most one statement.
More...
Different styles for merging short functions containing at most one statement.
They can be read as a whole for compatibility. The choices are:
- None Never merge functions into a single line.
- InlineOnly Only merge functions defined inside a class. Same as inline, except it does not implies empty: i.e. top level empty functions are not merged either. See Inline of ShortFunctionStyle.
class Foo {
void f() { foo(); }
};
void f() {
foo();
}
void f() {
}
- Empty Only merge empty functions. See Empty of ShortFunctionStyle.
void f() {}
void f2() {
bar2();
}
- Inline Only merge functions defined inside a class. Implies empty. See Inline and Empty of ShortFunctionStyle.
class Foo {
void f() { foo(); }
};
void f() {
foo();
}
void f() {}
- All Merge all functions fitting on a single line.
class Foo {
void f() { foo(); }
};
void f() { bar(); }
Also can be specified as a nested configuration flag:
# Example of usage:
AllowShortFunctionsOnASingleLine: InlineOnly
# or more granular control:
AllowShortFunctionsOnASingleLine:
Empty: false
Inline: true
Other: false
Definition at line 898 of file Format.h.