c++11 variant since my compiler is apparently old
I think this is pretty compliant with a real variant with a few different function names probably
using my_variant = variant<std::string, double, T>;
my_variant v;
v = std::string();
double value = 12;
v = value;
double new_value = v.get<double>();
// It's not a string, so this will throw
std::string thats_not_a_string = v.get<std::string>();
struct my_visitor
{
void operator()(const std::string&);
void operator()(const double&);
void operator()(T&);
}
v.apply_visitor<my_visitor>()