g++ and templates

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

 



Hi,

Can anyone tell me why the following code won't compile with g++ (4.1.2) ?

class U
{
        protected :
                int h;
};

template<typename T> class A: public U
{
};

template<typename T> class B: public A<T>
{
        public :
                void foo(int t)
                {
                        h = t;
                }
};

int main()
{
        return 0;
}

It is, however, "digested" well by g++ 3.2.2 and g++ 3.3.4

Thank you.

-- 
Mihai Donțu

[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