-
friend templates
How do I make all instances of a template, friend to a class. I tried deriving a base class which I made a friend of, but I don't want to call the base class static functions to access every friendly class members, first it's a pain in the ass and second you don't get the feeling of OOP, there has to be another way?
-
Doesn't this work?
Code:
class A {};
template <typename T>
class B
{
friend class A;
};
-
quite opposite
more like
Code:
class A {
friend template B;
};
template <typename T>
class B {};
but is it possible, if so how?