I need to know if there's a way to store generic types without using the void* pointer. I've seen ways of using void* pointer to hold the generic type but I'm looking for a different approach. Here's what I mean:
struct var_info
{
string var_name;
string data_type;
(numerical type here) value;
};
"value" can be any numerical type: int, short, long, double, float, etc... I need to do this because I want to put this info into a parameterized container such as a vector, or hash table. Please let me know if this is possible and any help is appreciated.
struct var_info
{
string var_name;
string data_type;
(numerical type here) value;
};
"value" can be any numerical type: int, short, long, double, float, etc... I need to do this because I want to put this info into a parameterized container such as a vector, or hash table. Please let me know if this is possible and any help is appreciated.