【问题标题】:Placement of const with clang-format用 clang 格式放置 const
【发布时间】:2017-09-12 12:28:46
【问题描述】:

clang-format 有大量关于空格的配置选项以及一些关于代码顺序(包含顺序)的配置选项。是否可以重新排序 const 限定符,以便将它们放置在相应类型的右侧?

示例:声明 const int x = 0; 应格式化为 int const x = 0;

【问题讨论】:

  • 他们一直在向clang-tidy 添加规则以转换代码以遵循 C++ 核心指南。也许您可以要求他们在添加 NL.26 时也添加一条规则来做相反的事情。

标签: c++ clang-format


【解决方案1】:

不,根据clang-format 的当前documentation 没有提及此功能。

【讨论】:

    【解决方案2】:

    此功能似乎正在开发中:https://reviews.llvm.org/D69764

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-27
      • 1970-01-01
      • 1970-01-01
      • 2018-04-11
      相关资源
      最近更新 更多