25 #ifndef _STRING_CONVERSIONS_H
26 #define _STRING_CONVERSIONS_H 1
28 #pragma GCC system_header
41 template<typename _TRet, typename _Ret = _TRet, typename _CharT,
44 __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
45 const
char* __name, const _CharT* __str,
std::
size_t* __idx,
52 const _TRet __tmp = __convf(__str, &__endptr, __base...);
54 if (__endptr == __str)
55 std::__throw_invalid_argument(__name);
56 else if (errno == ERANGE
57 || (std::__are_same<_Ret, int>::__value
58 && (__tmp < __numeric_traits<int>::__min
59 || __tmp > __numeric_traits<int>::__max)))
60 std::__throw_out_of_range(__name);
65 *__idx = __endptr - __str;
71 template<
typename _String,
typename _CharT =
typename _String::value_type>
73 __to_xstring(
int (*__convf) (_CharT*, std::size_t,
const _CharT*,
74 __builtin_va_list), std::size_t __n,
75 const _CharT* __fmt, ...)
79 _CharT* __s =
static_cast<_CharT*
>(__builtin_alloca(
sizeof(_CharT)
82 __builtin_va_list __args;
83 __builtin_va_start(__args, __fmt);
85 const int __len = __convf(__s, __n, __fmt, __args);
87 __builtin_va_end(__args);
89 return _String(__s, __s + __len);
92 _GLIBCXX_END_NAMESPACE
94 #endif // _STRING_CONVERSIONS_H
ISO C++ entities toplevel namespace is std.
GNU extensions for public use.