将函数的左大括号移动到下一行是一种常见的做法。
如何使用astyle(代码美化器)在类方法中应用它?
example:
// 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;
}
}
};
我的所有尝试仅适用于全局功能。
Both --style=kr / -A3
and --style=linux / -A8
选项也应该适用于类方法。
来自文档:
括号从命名空间、类和函数定义中断开。括号附加到函数内的语句。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)