Variant: Converted from strtol/substr to std::stoi/std::compare

This commit is contained in:
Paul Beckingham 2015-11-01 21:33:07 -05:00
parent bdfd22ad88
commit 6df55c9156

View file

@ -1871,7 +1871,7 @@ void Variant::cast (const enum type new_type)
_string == "0.0") ? false : true;
break;
case type_integer:
_integer = (int) strtol (_string.c_str (), NULL, (_string.substr (0, 2) == "0x" ? 16 : 10));
_integer = std::stoi (_string, NULL, (_string.compare (0, 2, "0x", 2) ? 10 : 16));
break;
case type_real: _real = std::stod (_string); break;
case type_string: break;