Problem with a complex-ish template

David Nolden zwabel at googlemail.com
Sat Jan 16 13:45:48 UTC 2010


Am Sonntag 06 Dezember 2009 04:14:01 schrieb Nicolas Alvarez:
> I'm writing some tests using the "mockpp" framework for mock objects.
> Its code emulates variadic templates using template specialization in
> several places.
> 
> At one point, it uses a helper class to count the number of arguments. For
> example, CountParameters<void, int, int>::value == 2 (not 3; the first
> argument is not used so you have a way of having 0 arguments). KDevelop
> doesn't handle  this template correctly. As a result, if I have this
> partially-specialized template:
> 
> template<unsigned params>
> struct Switch
> {
> };
> template<>
> struct Switch<2>
> {
>   void foo(int x, int y) { cout << "two args\n"; }
> };
> 
> If I create a Switch<2> object, kdevelop completes its method (foo)
> correctly. But if it's a Switch<CountParameters<void,int,int>::value>, the
> completion doesn't work.
> 
> A fully-compiling testcase is here: http://pastebin.ca/1703800
> 
> The foo() call in line 55 shows underlined in yellow. Typing "obj." inside
> main doesn't complete anything.

Hi! Please check whether there already is a bug-report for this issue, and if 
not, create one. That will allow tracking this issue.

Greetings, David




More information about the KDevelop-devel mailing list