Exception treatment: throw object instead of pointer

Closes #1685
This commit is contained in:
Evgeny Mandrikov 2016-03-27 00:43:26 +01:00 committed by Don Ho
parent 4c6e5af484
commit 91c9897baf
1 changed files with 2 additions and 2 deletions

View File

@ -839,9 +839,9 @@ double stodLocale(const generic_string& str, _locale_t loc, size_t* idx)
double ans = ::_wcstod_l(ptr, &eptr, loc);
#endif
if (ptr == eptr)
throw new std::invalid_argument("invalid stod argument");
throw std::invalid_argument("invalid stod argument");
if (errno == ERANGE)
throw new std::out_of_range("stod argument out of range");
throw std::out_of_range("stod argument out of range");
if (idx != NULL)
*idx = (size_t)(eptr - ptr);
return ans;