diff Core/EnumerationDictionary.h @ 2975:e62e296a5714

use Toolbox::IsIntegeer instead of try_lexical_convert that is not available on some platform
author am@osimis.io
date Thu, 06 Dec 2018 11:16:23 +0100
parents 146eaed9b02c
children 4e43e67f8ecf
line wrap: on
line diff
--- a/Core/EnumerationDictionary.h	Thu Dec 06 10:39:27 2018 +0100
+++ b/Core/EnumerationDictionary.h	Thu Dec 06 11:16:23 2018 +0100
@@ -37,7 +37,6 @@
 
 #include "Toolbox.h"
 #include <boost/lexical_cast.hpp>
-#include <boost/lexical_cast/try_lexical_convert.hpp>
 #include <string>
 #include <map>
 
@@ -85,10 +84,9 @@
 
       Enumeration Translate(const std::string& str) const
       {
-        int numericalValue; // at this stage, we don't know if str is an alias or a numerical value
-        if (boost::conversion::try_lexical_convert<int>(str, numericalValue))
+        if (Toolbox::IsInteger(str))
         {
-          return static_cast<Enumeration>(numericalValue);
+          return static_cast<Enumeration>(boost::lexical_cast<int>(str));
         }
 
         typename StringToEnumeration::const_iterator