【问题标题】:cpp template<> spacing using clang-format 3.6 not working as expected使用 clang-format 3.6 的 cpp 模板<> 间距未按预期工作
【发布时间】:2015-12-22 20:03:28
【问题描述】:

我在vim 中使用clang-format version 3.6 on Fedora 21,将clang-format.py 用于cpp 代码。除了模板定义之外,代码看起来与预期的一样。 template&lt;typename T&gt; 的代码正在更改为 template &lt;typename T&gt; 唯一看起来比较接近的选项 ObjCSpaceBeforeProtocolList 我设置为 false 但它仍然在单词模板和尖括号之间放置空格。有谁知道如何防止在单词模板和尖括号之间插入空格?

【问题讨论】:

  • 为什么要阻止这种情况?你不觉得template &lt;typename T&gt;template&lt;typename T&gt; 甚至template&lt; typename T &gt; 更易读

标签: c++ templates vim clang-format


【解决方案1】:

截至撰写本文时(2015 年 12 月),您还不能。请参阅this bug report,他们说他们不会修复它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多