libstdc++: Shorten integer std::to/from_chars symbol names
For std::to_chars:
The constrained alias __integer_to_chars_result_type seems unnecessary
ever since
r10-3080-g28f0075742ed58 got rid of the only public overload
which used it. Now only non-public overloads are constrained by it
(through their return type) and these non-public overloads aren't used
in a SFINAE context, so the constraints have no observable effect. So
this patch gets rid of this alias, which greatly shortens the symbol names
of the affected functions (since the expanded alias is quite large).
For std::from_chars:
We can't get rid of the corresponding alias because its constrains the
public integer std::from_chars overload. But we can avoid having the
constraint bloat the mangled name by instead encoding it as a defaulted
template parameter. We use the non-type parameter form
enable_if_t<..., int> = 0
instead of the type parameter form
typename = enable_if_t<...>
because the type form can be bypassed by giving an explicit template
argument for the type parameter, e.g. 'std::from_chars<int, void>(...)',
so the non-type form seems like the more robust choice.
In passing, use __is_standard_integer in the constraint.
libstdc++-v3/ChangeLog:
* include/std/charconv (__detail::__integer_to_chars_result_type):
Remove.
(__detail::__to_chars_16): Use to_chars_result as return type.
(__detail::__to_chars_10): Likewise.
(__detail::__to_chars_8): Likewise.
(__detail::__to_chars_2): Likewise.
(__detail::__to_chars_i): Likewise.
(__detail::__integer_from_chars_result_type): Inline the
constraint into ...
(from_chars): ... here. Use __is_standard_integer in the
constraint. Encode constraint as a defaulted non-type template
parameter instead of within the return type.