Re: g++ compile error in unused template

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

 



On 7 February 2012 15:16, Jonathan Wakely wrote:
> On 7 February 2012 14:29, Michal Sojka wrote:
>> Hi list,
>>
>> does anyone know why I get the following error when compiling this code?
>
> The syntax is invalid.
>
>> 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> >();
>
> You must tell the compiler that func is a template:
>
>               Base<T>::template func< Child<T> >();

See http://womble.decadent.org.uk/c++/template-faq.html#disambiguation
for more details.



[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