In the code below gcc says
test.cpp: In constructor `SingleInfoDial og::SingleInfoD ialog(const
PlayableSetBase &)':
test.cpp:2: error: `class PlayableSetBase ' is inaccessible
test.cpp:24: error: within this context
Obviosly gcc does not manage to pass the parameter of type const
PlayableSetBase & to the constructor of InfoDialog because there is a
private base class with the same name. Is this really not allowed?
Marcel
-----
class PlayableSetBase
{
};
class OwnedPlayableSe t
: public PlayableSetBase
{public:
OwnedPlayableSe t(const PlayableSetBase & r);
};
class InfoDialog
// a member is not sufficient because of the destruction sequence
: private OwnedPlayableSe t
{protected:
InfoDialog(cons t PlayableSetBase & key)
: OwnedPlayableSe t(key)
{}
};
class SingleInfoDialo g
: public InfoDialog
{public:
SingleInfoDialo g(const PlayableSetBase & key)
: InfoDialog(key) // <-- !!!
{}
};
test.cpp: In constructor `SingleInfoDial og::SingleInfoD ialog(const
PlayableSetBase &)':
test.cpp:2: error: `class PlayableSetBase ' is inaccessible
test.cpp:24: error: within this context
Obviosly gcc does not manage to pass the parameter of type const
PlayableSetBase & to the constructor of InfoDialog because there is a
private base class with the same name. Is this really not allowed?
Marcel
-----
class PlayableSetBase
{
};
class OwnedPlayableSe t
: public PlayableSetBase
{public:
OwnedPlayableSe t(const PlayableSetBase & r);
};
class InfoDialog
// a member is not sufficient because of the destruction sequence
: private OwnedPlayableSe t
{protected:
InfoDialog(cons t PlayableSetBase & key)
: OwnedPlayableSe t(key)
{}
};
class SingleInfoDialo g
: public InfoDialog
{public:
SingleInfoDialo g(const PlayableSetBase & key)
: InfoDialog(key) // <-- !!!
{}
};
Comment