This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

template parameters cannot be friends


Hello,
would you suggest to me, why gcc 3.3.3 can not compile this:

template<class T>
class Base
{
    friend T;
};

class A:public Base<A>
{
};

# cc test.cpp
test.cpp:6: error: template parameters cannot be friends

while Intel C++, MS VisualC++, gcc 2.95 do.
Does it conflict with C++ standart?
How can i change code to produce such behaviour? (I need eliminate errors like "class A:public Base<B>")
Thank you.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]