gpt4 book ai didi

c++ - Uncrustify:删除模板角度之间的空间不起作用

转载 作者:行者123 更新时间:2023-11-30 01:43:04 24 4
gpt4 key购买 nike

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

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)
{
}

输出:相同。

如何去掉角之间的空格?

最佳答案

升级 uncrustify0.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

关于c++ - Uncrustify:删除模板角度之间的空间不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38422835/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com