最佳答案
是否有一个 clang-format 选项可以将大括号添加到所有 if ()/do/while 语句等?
例句
if( i == 42 )
std::cout << "You found the meaning of life\n";
else
std::cout << "Wrong!\n";
到
if( i == 42 )
{
std::cout << "You found the meaning of life\n";
}
else
{
std::cout << "Wrong!\n";
}
吸毒
$ clang-format --version
clang-format version 3.6.0