I've got a special configuration to build and I don't know how to write this :
template <typename VarType>
class A
{
protected:
VarType m_myVar;
}
template <typename VarType>
class B : public A<VarType>
{
}
class C : public B<SpecialType>
{
void DoSomething()
{
m_myVar.PrivateFunction();
}
}
class SpecialType
{
private:
void PrivateFunction()
{
//Do something
}
}
How can I use the keyword friend to make it work ??
Thanks for your answers.
Just declare C
as friend of SpecialType
...
class SpecialType
{
private:
friend class C;
void PrivateFunction()
{
//Do something
}
};