id_string,
id_integer,
id_reference
} type;
union Data {
std::string string;
int32_t integer;
Variable *reference;
} data;
};
Any idea why I get "call to implicitly-deleted default constructor" when tring to use this struct?
Probably it will warn you about where is the default constructor for Variable struct.
Also, in my opinion it is too dangerous to use union for unaligned classes and types.
Обсуждают сегодня