奇怪的 getter 名称在 eclipse-cdt 的自动生成中

Weird getter name in the automatic generation of them by eclipse-cdt

在特定情况下,变量名以 1 个字符开头,eclipse 生成的自动 getter 删除此字符,例如:

private:

int xVel;
int yVel;
int zVel;

生成:

public:

int getVel();  //<-- this return xVel;
int getVel();  //<-- this return yVel;
int getVel();  //<-- this return zVel;

这对我来说太烦人了,因为创建了 3 个同名函数。

我 google 它但我没有找到明确的答案,因为名称约定,如果我没记错的话,说第一个字母被转换为小写,但没有提到删除字符.我的意思是,在 camelCase 约定中,变量 xVel 的 getter 是 getXVel() 或至少我期望如此。

我可以通过偏好编辑的选项没有解决我的问题:

这是一个错误吗?有什么解决办法吗?

eclipse-cdt使用的版本是:

面向 C/C++ 开发人员的 Eclipse IDE 版本:2018-09 (4.9.0) 构建 ID:20180917-1800

面向 C/C++ 开发人员的 Eclipse IDE 版本:Oxygen.3a 版本 (4.7.3a) 构建 ID:20180405-1200

两者具有相同的行为

这是一个错误。我鼓励您在 CDT's bug tracker.

中提交它