I'm trying to assign a float to a defined value in my std::map using std::variant. I initialized my map this way:
std::map<std::string,std::variant<float,int,bool,std::string> kwargs;
kwargs["type"] = "linear";
kwargs["flag"] = true;
kwargs["height"] = 5;
kwargs["length"] = 4.5;
I'm trying to archive this operation:
float f = kwargs["length"];
float a = f+0.5;
How can I transfer std::map key into a float for simple arithmetic operation?