Date
2014-11-08.16:43:57
Message id
7174

Content

Proposed resolution:

This wording is relative to N3936.

  1. Change [string.conversions] p4+p6 as indicated:

    float stof(const string& str, size_t* idx = 0);
    double stod(const string& str, size_t* idx = 0);
    long double stold(const string& str, size_t* idx = 0);
    

    -4- Effects: the first twoThese functions call strtof(str.c_str(), ptr), strtod(str.c_str(), ptr), and the third function calls strtold(str.c_str(), ptr), respectively. Each function returns the converted result, if any. […]

    […]

    -6- Throws: invalid_argument if strtof, strtod, or strtold reports that no conversion could be performed. Throws out_of_range if strtof, strtod, or strtold sets errno to ERANGE or if the converted value is outside the range of representable values for the return type.

  2. Change [string.conversions] p11+p13 as indicated:

    float stof(const wstring& str, size_t* idx = 0);
    double stod(const wstring& str, size_t* idx = 0);
    long double stold(const wstring& str, size_t* idx = 0);
    

    -11- Effects: the first twoThese functions call wcstof(str.c_str(), ptr), wcstod(str.c_str(), ptr), and the third function calls wcstold(str.c_str(), ptr), respectively. Each function returns the converted result, if any. […]

    […]

    -13- Throws: invalid_argument if wcstof, wcstod, or wcstold reports that no conversion could be performed. Throws out_of_range if wcstof, wcstod, or wcstold sets errno to ERANGE.