小编Ádá*_*kai的帖子

在冒号之前和在构造函数中的逗号之后放置

我正在尝试创建一个构造函数初始化程序格式,如:

Constructor()
  : initializer1(),
    initializer2()
Run Code Online (Sandbox Code Playgroud)

根据文档,我试图设置BreakConstructorInitializersBeforeColon(描述说:"在冒号之前和逗号之后打破构造函数初始化程序.",这正是我想要的),但它是在逗号之前放置,这不是我想要的是.我做错了什么,或者这是clang格式的错误?我尝试了clang-format-5.0和clang-format-6.0,它们的行为方式相同.

这是我完整的.clang格式文件:

---
Language:        Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands:   true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: TopLevel
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:   
  AfterClass:      true
  AfterControlStatement: true
  AfterEnum:       true
  AfterFunction:   true
  AfterNamespace:  true
  AfterObjCDeclaration: true
  AfterStruct:     true
  AfterUnion:      true
  BeforeCatch:     true
  BeforeElse:      true
  IndentBraces:    true
  SplitEmptyFunction: true
  SplitEmptyRecord: …
Run Code Online (Sandbox Code Playgroud)

c++ auto-indent clang-format

9
推荐指数
1
解决办法
1517
查看次数

标签 统计

auto-indent ×1

c++ ×1

clang-format ×1