C
Chris Schadl
Okay, I'm having a bit of a brain-fart and I can't remember how I would do
this.
Say I have the following:
template <typename T1, typename T2> class A; // Forward declaration of A
template <typename T1, typename T2>
class B
{
private:
/* .... */
public:
friend class A<T1, T2>; // OK - B sees forward declaration of A
/* .... */
};
template <typename T1, typename T2> // Definition of A
class A
{
private:
class<T1, T2> B;
/* .... */
public:
class C { /* .... */ };
};
How do I make private members of B accessable to C? Simply adding `friend
class A<T1, T2>::C;` to class B dosen't work (my compiler complains A has
no nested class C) and I'm not entierly certian of what the correct syntax
is for a forward declaration of A::C is if A is a template class. Any
ideas?
Thanks,
Chris Schadl
this.
Say I have the following:
template <typename T1, typename T2> class A; // Forward declaration of A
template <typename T1, typename T2>
class B
{
private:
/* .... */
public:
friend class A<T1, T2>; // OK - B sees forward declaration of A
/* .... */
};
template <typename T1, typename T2> // Definition of A
class A
{
private:
class<T1, T2> B;
/* .... */
public:
class C { /* .... */ };
};
How do I make private members of B accessable to C? Simply adding `friend
class A<T1, T2>::C;` to class B dosen't work (my compiler complains A has
no nested class C) and I'm not entierly certian of what the correct syntax
is for a forward declaration of A::C is if A is a template class. Any
ideas?
Thanks,
Chris Schadl