How do I grant a template access to protected functions of some other class, i.e.
 
template <class cType> class tTemplate
{
public:
   void CallProtectedFunc()
   {
      mType->ProtectedFunc();
   }
protected:
   cType *mType;
};
 
class cObject
{
protected:
   void ProtectedFunc();
 
   friend tTemplate;
};
 
class cDerived : public cObject
{
 
};
 
The above works for instances of cObject, but not for the derived classes, where it generates an compiler error saying that the protected function cannot be accessed.
 
Is there any way around this? Or is the only alternative declaring tTemplate as a friend in all subclasses?
 
Jim Offerman
Innovade.
The Netherlands