0

I try to get template classes which are using other template classes to implement. But I get only compiler error.

I tried many things with adding ::template or .template at different locations, but nothing did help. I think it will be easy to fix - if I know where I made the error. For testing I implemented this one, which get's the same error:

#include <iostream>
#include <string>

class D {
    public:
    template<class Class>
    void uffu() {
    };
};

class X {
};

template<class C>
class A: public D {
    public:
    void print() {
        std::cout << "a" << std::endl;
    }
    D d;
};

template<class C>
class B: public A<C> {
    public:
    void geek() {
        A<C>::d.uffu<X>();  // Line 27
        A<C>::print();
    }
};

class C: public B<C> {
};

int main()
{
    auto c = new C();
    c->geek();
}

Error message for that is:

In member function 'void B<C>::geek()':
27:23: error: expected primary-expression before '>' token
27:25: error: expected primary-expression before ')' token
tsschulz
  • 23
  • 4

0 Answers0