Re: c++: too many templates?

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

 



On Thu, 2008-10-23 at 04:14 -0700, @ wrote:
> why the following code cannot be compiled?
> 
> template <typename TC>
> class C
> {
> 	template <typename TF>
> 	void f() {}
> };
> 
> template <typename T>
> void test()
> {
> 	C<T> c;
> 	c.f<int>();
> }
> 
> gcc-4.3.2 on "c.f<int>();" reports error: expected primary-expression before
> ‘int’

Try:

void test()
{
        C<T> c;
        c.template f<int>();
}

Regards,
Arturs Zoldners



[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