g++ compile error in unused template

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

 



Hi list,

does anyone know why I get the following error when compiling this code?

template<class T>
struct Base {
        template <class A>
        void func() {}
};

template<class T>
struct Child : public Base<T> {
        unsigned func2() {
                Base<T>::func< Child<T> >();
        }
};

main() {}

The compiler output is:

x.cc: In member function ‘unsigned int Child<T>::func2()’:
x.cc:10:41: error: expected primary-expression before ‘>’ token
x.cc:10:43: error: expected primary-expression before ‘)’ token

Compiler is "g++ (Debian 4.6.2-9) 4.6.2", but the result is the same
even with g++ 4.4 and g++ 4.5.

Thank you,
-Michal



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux