@@ -69,32 +69,32 @@ void strtod_from_string(const std::string &st, T& d);
6969
7070template <>
7171void strtod_from_string (const std::string &st, double & d) {
72- char *pr = (char *)st.data ();
72+ char *pr = (char *)st.c_str ();
7373#ifdef _WIN32
7474 static _locale_t c_locale = _create_locale (LC_ALL, " C" );
75- d = _strtod_l (st.data (), &pr, c_locale);
75+ d = _strtod_l (st.c_str (), &pr, c_locale);
7676#else
7777 static locale_t c_locale = newlocale (LC_ALL_MASK, " C" , NULL );
78- d = strtod_l (st.data (), &pr, c_locale);
78+ d = strtod_l (st.c_str (), &pr, c_locale);
7979#endif
80- if (pr == st.data ()) {
80+ if (pr == st.c_str ()) {
8181 throw std::runtime_error (" bug in strtod_from_string" );
8282 }
8383}
8484
8585template <>
8686void strtod_from_string (const std::string &st, float & d) {
87- char *pr = (char *)st.data ();
87+ char *pr = (char *)st.c_str ();
8888#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__)
89- d = cygwin_strtod_l (st, &pr);
89+ d = cygwin_strtod_l (st. c_str () , &pr);
9090#elif defined(_WIN32)
9191 static _locale_t c_locale = _create_locale (LC_ALL, " C" );
92- d = _strtof_l (st.data (), &pr, c_locale);
92+ d = _strtof_l (st.c_str (), &pr, c_locale);
9393#else
9494 static locale_t c_locale = newlocale (LC_ALL_MASK, " C" , NULL );
95- d = strtof_l (st.data (), &pr, c_locale);
95+ d = strtof_l (st.c_str (), &pr, c_locale);
9696#endif
97- if (pr == st.data ()) {
97+ if (pr == st.c_str ()) {
9898 throw std::runtime_error (" bug in strtod_from_string" );
9999 }
100100}
0 commit comments