Completion of template specialization.

David Nolden zwabel at googlemail.com
Wed Nov 12 19:34:15 UTC 2008


Am Mittwoch, 12. November 2008 19:42:12 schrieb Esben Mose Hansen:
> Hi,
>
> a follow-up to my earlier mail: It appears that the following code gives
> some odd completions:
>
> template<bool T> struct truth_type{
>   int n;
> };
>
> template<> struct truth_type<true> {
>   int m;
> };
>
>
> int main() {
>   truth_type<true> tt;
>   truth_type<false> ft;
>   return tt.m || ft.n;
> }
>
> (Yes, yes, I know, sillly code)
>
> placing the cursor after tt. in the last line should give me "int m" as the
> only choice, but it gives me "int n" and "true T". Placing it after ft. in
> the same line gives me "int m" (correctly) and also "false T". What's with
> the false/true types named T? Surely that is a bug :)
>
> I will perhaps poke around in this a bit more, and see what I can find.
Those "T" things are not a bug. It's the declaration of the template-parameter 
shown, that you call "T". Maybe it shouldn't be shown, yeah. ;)

About the m and mm: Picking of explicitly declared teplate instatiations is 
not implemented yet. I was planning to do it for a long time, but haven't 
come to it yet.

Greetings, David




More information about the KDevelop-devel mailing list