Dodo
Oct30-04, 08:33 AM
Hopefully this sort of questions will soon be answered in the tutorial (good effort, Dduardo!), but for the time being, this one is not.
I have the following scheme:
class Foo {
...
protected:
struct PartOne {
...
};
struct PartTwo {
...
PartOne* someFunction ();
};};
And I get a complaint of PartTwo's being unable to access a protected symbol (PartOne) from Foo.
A "friend struct PartTwo;" right after the "protected:" indication doesn't seem to solve the problem, as I expected. (I'd prefer not to take the two Parts out of Foo, as independent structures.) Where am I thinking wrong?
Thanks very much in advance.
---
Edit: If this helps... actually I'm not getting the error in the declaration (like the above), but when later writing the implementation of 'someFunction', which spells like:
Foo::PartOne* Foo::PartTwo::someFunction () // <--- offending line
{
...
}
The MS VC++ 6.0 compiler says,
'PartOne' : cannot access protected struct declared in class 'Foo'
I have the following scheme:
class Foo {
...
protected:
struct PartOne {
...
};
struct PartTwo {
...
PartOne* someFunction ();
};};
And I get a complaint of PartTwo's being unable to access a protected symbol (PartOne) from Foo.
A "friend struct PartTwo;" right after the "protected:" indication doesn't seem to solve the problem, as I expected. (I'd prefer not to take the two Parts out of Foo, as independent structures.) Where am I thinking wrong?
Thanks very much in advance.
---
Edit: If this helps... actually I'm not getting the error in the declaration (like the above), but when later writing the implementation of 'someFunction', which spells like:
Foo::PartOne* Foo::PartTwo::someFunction () // <--- offending line
{
...
}
The MS VC++ 6.0 compiler says,
'PartOne' : cannot access protected struct declared in class 'Foo'