M
Marcel Müller
In the code below gcc says
test.cpp: In constructor `SingleInfoDialog::SingleInfoDialog(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 OwnedPlayableSet
: public PlayableSetBase
{public:
OwnedPlayableSet(const PlayableSetBase& r);
};
class InfoDialog
// a member is not sufficient because of the destruction sequence
: private OwnedPlayableSet
{protected:
InfoDialog(const PlayableSetBase& key)
: OwnedPlayableSet(key)
{}
};
class SingleInfoDialog
: public InfoDialog
{public:
SingleInfoDialog(const PlayableSetBase& key)
: InfoDialog(key) // <-- !!!
{}
};
test.cpp: In constructor `SingleInfoDialog::SingleInfoDialog(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 OwnedPlayableSet
: public PlayableSetBase
{public:
OwnedPlayableSet(const PlayableSetBase& r);
};
class InfoDialog
// a member is not sufficient because of the destruction sequence
: private OwnedPlayableSet
{protected:
InfoDialog(const PlayableSetBase& key)
: OwnedPlayableSet(key)
{}
};
class SingleInfoDialog
: public InfoDialog
{public:
SingleInfoDialog(const PlayableSetBase& key)
: InfoDialog(key) // <-- !!!
{}
};