diff --git a/gazebo/Preferences.h b/gazebo/Preferences.h index 73bf589..de7199f 100644 --- a/gazebo/Preferences.h +++ b/gazebo/Preferences.h @@ -14,10 +14,9 @@ private: void readFromFile() { std::ifstream file(storagePath); - std::string key; - float value; + std::string key, value; while (file >> key >> value) { - storage[key] = value; + storage[key] = std::stof(value); // using stof to support NaN and Infinity } }