diff Core/EnumerationDictionary.h @ 2722:a191bbd55a2b jobs

fix for older versions of boost
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 12 Jul 2018 14:32:03 +0200
parents 2c684841da15
children 146eaed9b02c
line wrap: on
line diff
--- a/Core/EnumerationDictionary.h	Thu Jul 12 12:55:48 2018 +0200
+++ b/Core/EnumerationDictionary.h	Thu Jul 12 14:32:03 2018 +0200
@@ -84,10 +84,12 @@
 
       Enumeration Translate(const std::string& str) const
       {
-        int value;
-        if (boost::conversion::try_lexical_convert<int>(str, value))
+        try
         {
-          return static_cast<Enumeration>(value);
+          return static_cast<Enumeration>(boost::lexical_cast<int>(str));
+        }
+        catch (boost::bad_lexical_cast&)
+        {
         }
 
         typename StringToEnumeration::const_iterator