Template class Uses.

Bertjan Broeksema bertjan at kdab.net
Wed Oct 7 11:55:02 UTC 2009


Hi all,

I've this simple piece of code:

--- begin ---
template <class T> class Test
{ };

int main()
{
  Test<float> floatTest;
  Test<int> intTest;
  return 0;
}
--- end ---

Renaming Test at line one in KDevelop doesn't result in renaming of the 
instantiations. Some small test I tried locally seems to show that there are 
no uses coupled to declarations of template classes. However when hovering 
over the Test<float> declaration I can see where it is declared so there seems 
to be *some* link between template instantiations and the declarations.

So my questions are:

1) How do I get from the ClassDeclaration object representing the Test class 
info about the fact that it is actually a template class?

2) How do I get to uses (instantiations so you want) of template classes from 
its declarations?

3) If the answer on 2 is "not possible", how do I implement such a thing?

Cheers,

Bertjan




More information about the KDevelop-devel mailing list