AllowShortFunctionsOnASingleLine
AllowShortFunctionsOnASingleLine (ShortFunctionStyle)¶
Info
clang-format 3.5
根据值,int f() { return 0; } 可以放在一行上。
可能的值:
SFS_None: 永远不要将函数合并到一行中。
SFS_InlineOnly: 只合并类中定义的函数。与 Inline 相同,除了它不暗含 Empty: 即顶层空函数也不合并。
class Foo {
void f() { foo(); }
};
void f() {
foo();
}
void f() {
}
SFS_Empty: 只合并空函数。
void f() {}
void f2() {
bar2();
}
SFS_Inline: 只合并类中定义的函数。暗含 Empty。
class Foo {
void f() { foo(); }
};
void f() {
foo();
}
void f() {}
SFS_All: 合并所有拟合在一行上的函数。
class Foo {
void f() { foo(); }
};
void f() { bar(); }
最后更新:
2022-10-31