Say I have a class like this:
class Instruction {
std::string name;
enum valtype { STRING, INSTRUCTION };
Instruction* value_i;
std::string value_s;
}
Is there any way to just make one variable and have it's type specified at runtime? I have looked at unions, but they can't have things like strings in them. I would prefer C++98
.