Mercurial > hg > orthanc
diff Core/EnumerationDictionary.h @ 2708:83c991aeb611 jobs
integration mainline->jobs
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Jul 2018 08:18:22 +0200 |
parents | 2c684841da15 |
children | a191bbd55a2b |
line wrap: on
line diff
--- a/Core/EnumerationDictionary.h Thu Jul 05 17:10:10 2018 +0200 +++ b/Core/EnumerationDictionary.h Mon Jul 09 08:18:22 2018 +0200 @@ -84,14 +84,11 @@ Enumeration Translate(const std::string& str) const { - try + int value; + if (boost::conversion::try_lexical_convert<int>(str, value)) { - int value = boost::lexical_cast<int>(str); return static_cast<Enumeration>(value); } - catch (boost::bad_lexical_cast) - { - } typename StringToEnumeration::const_iterator found = stringToEnumeration_.find(str);