Here is a simplified version of my scenario:
class Base
{
class Entry
{
...
}
std::vector<Entry *> entryList;
void processEntry() = 0;
void OnProcessEntry(); // processEntry callback
};
class Derived : public Base
{
class Entry : public Base::Entry
{
...
}
void processEntry()
{
...
entryList.push_back(new Entry);
OnProcessEntry();
}
};
When I copy a Derived::Entry
pointer into entryList
, the object is sliced to Base::Entry
. Is there any way I can get the Entry back to its original "unsliced" state within the base class method OnProcessEntry
?
If anybody can recommend a more appropriate title please do and I will edit.
Thanks.