help-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fw: Fw: ctags with overloaded (or scoped) functions


From: Shigio Yamaguchi
Subject: Re: Fw: Fw: ctags with overloaded (or scoped) functions
Date: Sat, 04 Feb 2006 12:05:51 +0900

Though global can treat one or more functions of the same name,
it doesn't distinguish them. The work is left to the user.
Since global(1) shows the list of all candidates of 'Cout' like
follows, you can select appropriate one from it.

$ global -x Cout
Cout                2 test.cc        void Cout(int num) { cout << num
Cout                3 test.cc        void Cout(float num) { cout << n
Cout                7 test.cc            void Cout(int num) { cout <<

Though I don't know your environment, most vi editers take you
to the first entry of the candidate list. If you hope to select
one from the list, I recommend you the use of emacs (gtags.el) or
bash (globash.rc).

> Is there a setting in global to have it distinguish between different
> functions with the same name based on their parameter lists or declared
> scope?
> For example, given the following file:
> //==========================================
> #include <iostream>
> void Cout(int num) { cout << num << endl; }
> void Cout(float num) { cout << num << endl; }
> class MyClass
> {
>   public:
>     void Cout(int num) { cout << num << endl; }
> };
> int main(int argc, char* argv[])
> {
>   int x = 0;
>   float y = 0.0f;
>   Cout(x);
>   Cout(y);
>   MyClass mc;
>   mc.Cout(x);
> }
> //==========================================
> Jumping from any of the three calls to Cout in main() takes me to the
> version that accepts an int parameter, rather than the most appropriate
> one.
--
Shigio YAMAGUCHI <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]