The default for export-silence-threshold is -INFINITY, written
as "-inf" (by cfgtool) into system_config. Yet parsing the config using
a std::stringstream results in "0" (due to bugs in various libc++).
// is set but to the same value as it already has
}
+/* Specialisation of ConfigVariable to deal with float (-inf etc)
+ * http://stackoverflow.com/questions/23374095/should-a-stringstream-parse-infinity-as-an-infinite-value
+ */
+template<> void
+ConfigVariable<float>::set_from_string (std::string const & s) {
+ value = std::strtof (s.c_str(), NULL);
+}
T value;
};
+/** Specialisation of ConfigVariable to deal with float (-inf etc) */
+template<> void
+ConfigVariable<float>::set_from_string (std::string const & s);
+
/** Specialisation of ConfigVariable for std::string to cope with whitespace properly */
template<>
class /*LIBPBD_API*/ ConfigVariable<std::string> : public ConfigVariableBase