Indent 向 const 方法添加额外的 const
Indent adds extra const to const methods
这是我的 makefile
:
TRASH = *.o complex *~
complex: test.o complex.o
g++ -Wall -o $@ $^
test.o: test.cpp complex.hpp
g++ -Wall -c -o $@ $<
complex.o: complex.cpp complex.hpp
g++ -Wall -c -o $@ $<
PHONY: clean beauty
clean:
rm -f $(TRASH)
beauty:
indent -npsl -brf -cdb test.cpp complex.cpp complex.hpp
我的缩进选项格式代码如下:
int function () {
/*
Comments
*/
}
问题:
如果我有一些具有原型的 C++ 函数:Complex method_name(arguments) const;
每当我出于某种原因在 .cpp
文件上使用 make beauty
时,它会再添加一个 const
,而我的函数变成这样:
Complex method_name(arguments) const const {
/*
Comments
*/
}
注意: 头文件缩进得很好,但是 .cpp
文件缩进就像我上面描述的那样。
有人知道这可能是什么原因吗?
是的,我已经收到确认,这是当前缩进版本中的正式错误。
这是我的 makefile
:
TRASH = *.o complex *~
complex: test.o complex.o
g++ -Wall -o $@ $^
test.o: test.cpp complex.hpp
g++ -Wall -c -o $@ $<
complex.o: complex.cpp complex.hpp
g++ -Wall -c -o $@ $<
PHONY: clean beauty
clean:
rm -f $(TRASH)
beauty:
indent -npsl -brf -cdb test.cpp complex.cpp complex.hpp
我的缩进选项格式代码如下:
int function () {
/*
Comments
*/
}
问题:
如果我有一些具有原型的 C++ 函数:Complex method_name(arguments) const;
每当我出于某种原因在 .cpp
文件上使用 make beauty
时,它会再添加一个 const
,而我的函数变成这样:
Complex method_name(arguments) const const {
/*
Comments
*/
}
注意: 头文件缩进得很好,但是 .cpp
文件缩进就像我上面描述的那样。
有人知道这可能是什么原因吗?
是的,我已经收到确认,这是当前缩进版本中的正式错误。