clang-format

本文详细介绍了 C++ 的编码规范,包括基于 Google 风格的代码格式设置选项,如缩进宽度、模板声明的换行规则、注释的重新排版等。此外还涉及了函数、类、命名空间等元素的布局方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

BasedOnStyle: Google
IndentWidth: 4
TabWidth: 4
AlwaysBreakTemplateDeclarations: true
AllowShortFunctionsOnASingleLine: Inline 
BreakBeforeBraces: Linux
IndentCaseLabels: true
AccessModifierOffset: -4
BreakBeforeBraces: Custom
BraceWrapping:
    AfterClass: true
    AfterControlStatement: false
    AfterEnum:       true
    AfterFunction:   true
    AfterNamespace:  false
    AfterStruct:     true
    AfterUnion:      true

BreakConstructorInitializersBeforeComma: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
BinPackParameters: false
BinPackArguments: false
ReflowComments: false

Language: Cpp
ColumnLimit: 120

ForEachMacros:   
  - foreach
  - Q_FOREACH
  - BOOST_FOREACH
  - Q_localarea
Standard: Cpp11

AlignTrailingComments: true
PointerAlignment: Right
MaxEmptyLinesToKeep: 1
FixNamespaceComments: true
AlignConsecutiveDeclarations: true
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignEscapedNewlinesLeft: true
AllowAllParametersOfDeclarationOnNextLine: true
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值