C
Chris Dams
Dear all,
I would like to have a template class as friend of another class. If I write
class c
{ friend class t;
};
template <class T> class t
{
};
then this is not allowed and on my g++ version 4.0.2. It says that
"t is not a template type". Apparently this is because of the friend
declaration, because if I comment it out, the code compiles without errors.
But I want t to be a friend of c no matter what the template argument
of t is. Can anyone tell me how to do this?
Many thanks,
Chris
I would like to have a template class as friend of another class. If I write
class c
{ friend class t;
};
template <class T> class t
{
};
then this is not allowed and on my g++ version 4.0.2. It says that
"t is not a template type". Apparently this is because of the friend
declaration, because if I comment it out, the code compiles without errors.
But I want t to be a friend of c no matter what the template argument
of t is. Can anyone tell me how to do this?
Many thanks,
Chris