throw ConversionException if not all chars could be extracted

experiment/meta_header
Martchus 7 years ago
parent aff51370d9
commit d437126760
  1. 2
      conversion/stringconversion.h

@ -172,7 +172,7 @@ template <typename NumberType, typename StringType> LIB_EXPORT NumberType string
std::basic_stringstream<typename StringType::value_type> ss;
ss << std::setbase(base) << string;
NumberType result;
if(ss >> result) {
if((ss >> result) && ss.eof()) {
return result;
} else {
throw ConversionException("The specified string is no valid number.");

Loading…
Cancel
Save