D
David
Hello,
Is there a way to automatically have a member variable in a derived class
recast within that class. In other words, something like this:
class ABase
{
protected:
BBase *m_something;
public:
ABase(BBase *something);
..etc..
};
class ABaseDerived : public ABase
{
public:
ABaseDerived(BBaseDerived *something)
..etc..
};
I'd like m_something in ABaseDerived to be automatically cast to
BBaseDerived everyplace used in ABaseDerived.
Something like this:
class ABaseDerived : public ABase
{
protected:
reinterpret_cast<BBaseDerived *>(m_something); // this would be cool
public:
ABaseDerived(BBaseDerived *something)
..etc..
};
Is there a way to do that?
Thanks!
Is there a way to automatically have a member variable in a derived class
recast within that class. In other words, something like this:
class ABase
{
protected:
BBase *m_something;
public:
ABase(BBase *something);
..etc..
};
class ABaseDerived : public ABase
{
public:
ABaseDerived(BBaseDerived *something)
..etc..
};
I'd like m_something in ABaseDerived to be automatically cast to
BBaseDerived everyplace used in ABaseDerived.
Something like this:
class ABaseDerived : public ABase
{
protected:
reinterpret_cast<BBaseDerived *>(m_something); // this would be cool
public:
ABaseDerived(BBaseDerived *something)
..etc..
};
Is there a way to do that?
Thanks!