I'm trying to access protected variables of a template class with different template parameters. A friend declaration with template parameters is giving the following error:
multiple template parameter lists are not allowed
My code is
template<class O_, class P_>
class MyClass {
//multiple template parameter lists are not allowed
template<class R_> friend class MyClass<R_, P_>
//syntax error: template<
friend template<class R_> class MyClass<R_, P_>
public:
template<class R_>
ACopyConstructor(MyClass<R_, P_> &myclass) :
SomeVariable(myclass.SomeVariable)
{ }
protected:
O_ SomeVariable;
};
If I remove the protection and friend declaration it works.