1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-29 08:15:35 +00:00

Improve Boost apologia

This commit is contained in:
Capostrophic 2019-06-03 12:15:01 +03:00
parent 9502e9f3f7
commit dfb852cbb0
2 changed files with 4 additions and 4 deletions

View file

@ -30,8 +30,8 @@ namespace Fallback
{ {
try try
{ {
// We have to rely on Boost because std::stof from C++11 // We have to rely on Boost because std::stof from C++11 uses the current locale
// uses the current locale for separators which we don't want and often silently ignores parsing errors. // for separators (which is undesired) and it often silently ignores parsing errors.
return boost::lexical_cast<float>(fallback); return boost::lexical_cast<float>(fallback);
} }
catch (boost::bad_lexical_cast&) catch (boost::bad_lexical_cast&)

View file

@ -355,8 +355,8 @@ float Manager::getFloat (const std::string& setting, const std::string& category
const std::string value = getString(setting, category); const std::string value = getString(setting, category);
try try
{ {
// We have to rely on Boost because std::stof from C++11 // We have to rely on Boost because std::stof from C++11 uses the current locale
// uses the current locale for separators which we don't want and often silently ignores parsing errors. // for separators (which is undesired) and it often silently ignores parsing errors.
return boost::lexical_cast<float>(value); return boost::lexical_cast<float>(value);
} }
catch (boost::bad_lexical_cast&) catch (boost::bad_lexical_cast&)