M
Matthias =?ISO-8859-1?Q?K=E4ppler?=
Hello,
I just wanted to ask, if an outer and a nested class share implementation
details, e.g. in that both need to have access to a member of the nested
class, is it common practice to simply make those members of the nested
class public?
class Outer
{
class Inner
{
int bar; // Outer needs access to bar
};
};
Should I just make 'bar' public? Or is there a better solution to access
data in an inner class? I think in Java there are mechanisms built in the
language to exchange data between an inner and outer class, something like
a second this pointer which points to the inner class (or the other way
around, I cant quite remember).
Thanks in advance,
Matthias
I just wanted to ask, if an outer and a nested class share implementation
details, e.g. in that both need to have access to a member of the nested
class, is it common practice to simply make those members of the nested
class public?
class Outer
{
class Inner
{
int bar; // Outer needs access to bar
};
};
Should I just make 'bar' public? Or is there a better solution to access
data in an inner class? I think in Java there are mechanisms built in the
language to exchange data between an inner and outer class, something like
a second this pointer which points to the inner class (or the other way
around, I cant quite remember).
Thanks in advance,
Matthias