throw ConversionException if not all chars could be extracted

This commit is contained in:
Martchus 2015-11-28 00:19:44 +01:00
parent aff51370d9
commit d437126760
1 changed files with 1 additions and 1 deletions

View File

@ -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.");