使用ctags查找用c++中的构造函数声明的变量
Using ctags to find variables declared with a constructor in c++
使用此命令
ctags -R --c++-kinds=l -x test.cpp
ctags只能找到变量c2而不能找到变量c3
代码片段:
int main()
{
int c2 = 5;
int c3(3);
return 0;
}
通用ctags(https://ctags.io/)可以捕获c3。
[jet@localhost ctags]$ cat /tmp/foo.cpp
int main()
{
int c2 = 5;
int c3(3);
return 0;
}
[jet@localhost ctags]$ ./ctags --kinds-C++=+l -o - /tmp/foo.cpp
c2 /tmp/foo.cpp /^ int c2 = 5;$/;" l function:main typeref:typename:int file:
c3 /tmp/foo.cpp /^ int c3(3);$/;" l function:main typeref:typename:int file:
main /tmp/foo.cpp /^int main()$/;" f typeref:typename:int
相关文章:
- 我不明白为什么我声明一个空的内部结构并将其传递给构造函数
- 将派生类的构造函数声明为父类的友元
- 用初始化列表和超类构造函数声明子类构造函数的正确方式
- 如何使用构造函数声明指向用户定义对象的指针?
- 如何从构造函数声明新的私有变量?
- 根据二手构造函数声明成员
- 如何用类别的consumetrized构造函数声明使用类的比较对象设置的STL设置
- C++.奇怪的构造函数声明
- 使用ctags查找用c++中的构造函数声明的变量
- 将构造函数声明为private会显示错误.是否至少有一个公共构造函数是必需的
- 如何在C++中使用带参数的构造函数声明具有来自另一个类的类数据的对象
- 在构造函数声明中编写模板类型的参数列表是否有效?
- 在另一个类中使用自定义构造函数声明一个类
- 谷歌测试-构造函数声明错误
- 使用构造函数声明作为虚函数
- 无效地使用不完整的类型模板构造函数声明
- 将构造函数声明为显式时出现编译错误
- 它在构造函数声明中意味着什么
- 类构造函数声明了两次
- 有一种方法可以使用默认的复制构造函数声明复制构造函数非公共和?