【发布时间】:2017-01-23 10:03:41
【问题描述】:
我有如下代码sn-p,和我想要的一模一样:
#include <iostream>
int main(int argc, char* argv[])
{
for (auto i: { 1, 2, 3 })
{
std::cout << i << std::endl;
}
}
不幸的是,astyle 把它变成了:
#include <iostream>
int main(int argc, char* argv[])
{
for (auto i :
{
1, 2, 3
})
{
std::cout << i << std::endl;
}
}
有什么方法可以让 astyle 以不同的方式处理初始化列表大括号(即忽略它们)?
这些是我目前的选择:
--mode=c --style=allman --indent=spaces=4 -max-code-length=100 --attach-namespaces --pad-oper --pad-header
【问题讨论】:
-
我并不是要宣扬一种或另一种软件,但您是否考虑过使用 clang 格式?