[Ctags] C++ virtual function overrides in separate files
Brought to you by:
dhiebert
|
From: Marc L. <la...@ua...> - 2009-03-16 16:26:09
|
Hi,
I'm using gvim and ctags. I have multiple source and header files. A
function acts on a polymorphic type, and I want to jump to the method's
definition:
void func(Base * ptr)
{
// ...
base->my_func(); // <-- I want to jump the definition of "my_func"
}
where the rest of my code is setup as described below.
In gvim, the Ctrl+] should bring me to the definition of
Base::my_func(), but it doesn't. It brings me to the definition of
Sub2::my_func in sub2.cpp.
Can I achieve what I'm trying to using ctags? If so, how?
---
[in basefile.cpp]
class Base {
public:
virtual void my_func() = 0;
};
[in sub1.h]
class Sub1 : public Base
{
public:
virtual void my_func();
}
[in sub2.h]
class Sub2 : public Base
{
public:
virtual void my_func();
}
[in sub1.cpp]
void Sub1::my_func() { /* my impl */ }
[in sub2.cpp]
void Sub2::my_func() { /* my impl */ }
---
Thanks,
Marc
--
Any code of your own that you haven't looked at for six or more months
might as well have been written by someone else.
-- Eagleson's law
|