【发布时间】:2021-12-20 13:56:39
【问题描述】:
在 VsCode 中,我想将 Clang 格式更改为:
class Test {
public:
Test() : tmp(0)
{
if (0 == 0) {
std::cout << "hello" << std::endl;
}
}
~Test();
protected:
private:
int tmp;
};
但目前我得到了:
class Test {
public:
Test() : tmp(0) {
if (0 == 0) {
std::cout << "hello" << std::endl;
}
}
~Test();
protected:
private:
int tmp;
};
我的 CLang 设置:
{ BasedOnStyle: Google, IndentWidth: 4 }
【问题讨论】:
-
从 clang 格式的文档开始:clang.llvm.org/docs/ClangFormatStyleOptions.html
标签: c++ clang-format