関数の左中かっこを次の行に移動するのが一般的な方法です。スタイル(コード美化)を使用してクラスメソッドにこれを適用するにはどうすればよいですか?
例:
// this is an initial C++ code
class Class
{
public:
static int foo(bool x) {
if (x) {
return 42;
} else {
return 0;
}
}
};
変更されたバージョンは次のようになります。
class Class
{
public:
static int foo(bool x)
{ // this brace in next line
if (x) {
return 42;
} else {
return 0;
}
}
};
私のすべての試みは、グローバル関数に対してのみ機能します。