I have a struct
struct foo : public std::map<std::string, int>
{
};
and a child struct;
struct bar : public foo
{
int another_member;
}
But I can't use bar* b = dynamic_cast<bar*>(f)
where f is a pointer to a foo.
Even if I refactor foo
to
struct foo
{
std::map<std::string, int> m;
};
I still have the problem. I've played around with my RTTI settings to no avail. What on earth is going on?
The error is:
error C2683: 'dynamic_cast' : 'Credit::WaterfallSimulationResult' is not a polymorphic type