取消脱壳:删除模板角度之间的空间不起作用

Uncrustify: remove space between template angles doesn't work

本文关键字:之间 空间 不起作用 删除 取消      更新时间:2023-10-16

我想删除模板角度之间的空格,例如:

void Function (list<list<int> >);
                             ^
                             |
              This space should be removed.

为此,我使用sp_angle_shift = remove,但没有效果。

$ uncrustify -c uncrustify.cfg function.h --no-backup -l CPP

输入

void Function (const list<list<T> > data);
void Function (const list<list<T> > data)
{
}

输出:相同。

如何删除角度之间的空格?

uncrustify升级到 0.60 并添加/修改:

sp_angle_shift                           = remove
sp_permit_cpp11_shift                    = true

供您参考 :

# Add or remove space between '>' and '>' in '>>' (template stuff C++/C# only). Default=Add
sp_angle_shift                           = add      # ignore/add/remove/force
# Permit removal of the space between '>>' in 'foo<bar<int> >' (C++11 only). Default=False
# sp_angle_shift cannot remove the space without this option.
sp_permit_cpp11_shift                    = false    # false/true