P
propokergrad
Hello, say I have two classes:
class Base{...};
class Derived : public Base{...}
I would like to do something similar to this:
std::vector<Base*>::iterator b;
std::vector<Derived*>::iterator d;
d = vector_of_derived.begin();
b = *((std::vector<Base*>::iterator*)(&d));
Am I correct that this a really stupid thing to do? Is there a better
way of going about this? Thanks for any help!
-Mike
class Base{...};
class Derived : public Base{...}
I would like to do something similar to this:
std::vector<Base*>::iterator b;
std::vector<Derived*>::iterator d;
d = vector_of_derived.begin();
b = *((std::vector<Base*>::iterator*)(&d));
Am I correct that this a really stupid thing to do? Is there a better
way of going about this? Thanks for any help!
-Mike