Accessing a std::map of std::map like an array
问题 I have initialize a std::map of a std::map like as below: static std::map<std::string, std::map<std::string, float>> _ScalingMapFrequency = { {"mHz", {{"mHz", 1.0}}}, {"mHz", {{"Hz", 1e-3}}}, {"Hz", {{"mHz", 1e+3}}}, {"Hz", {{"Hz", 1.0}}}}; And now I am trying to access the float values in the following way: std::cout<<" the scaling factor is :"<<_ScalingMapFrequency["mHz"]["Hz"]; There is no problem when I compile and run the code but I am expecting to get "1e-3" instead I am always getting