| 105 | |
| 106 | template <typename V, typename S, typename F> |
| 107 | inline V as_integer_helper(const string& func, const S& str, size_t* idx, int base, F f) { |
| 108 | typename S::value_type* ptr = nullptr; |
| 109 | const typename S::value_type* const p = str.c_str(); |
| 110 | __libcpp_remove_reference_t<decltype(errno)> errno_save = errno; |
| 111 | errno = 0; |
| 112 | V r = f(p, &ptr, base); |
| 113 | swap(errno, errno_save); |
| 114 | if (errno_save == ERANGE) |
| 115 | throw_from_string_out_of_range(func); |
| 116 | if (ptr == p) |
| 117 | throw_from_string_invalid_arg(func); |
| 118 | if (idx) |
| 119 | *idx = static_cast<size_t>(ptr - p); |
| 120 | return r; |
| 121 | } |
| 122 | |
| 123 | template <typename V, typename S> |
| 124 | inline V as_integer(const string& func, const S& s, size_t* idx, int base); |
nothing calls this directly
no test coverage detected