[Bug libstdc++/126675] Document std::__format::__do_vformat_to or make the explicit instantiation extern
"marco.rubini08 at gmail dot com via Gcc-bugs" <[email protected]> Thu, 06 Aug 2026 08:17:48 +0000
| Newsgroups | gmane.comp.gcc.bugs |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126675
--- Comment #4 from Marco Rubini <marco.rubini08 at gmail dot com> ---
```
// The behavior of the formatters (interpretation of fill character) depends
// on the literal encoding. As explicit instantiation of __do_vformat_to
// instantiates formatters for types stored in basic_format_arg, we can
// support only single encoding, in this case unicode. This should cover
// most common use cases.
#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE
extern template _Sink_iter<char>
__do_vformat_to<char, 1>(_Sink_iter<char>, string_view,
format_context&);
# ifdef _GLIBCXX_USE_WCHAR_T
extern template _Sink_iter<wchar_t>
__do_vformat_to<wchar_t, 1>(_Sink_iter<wchar_t>, wstring_view,
wformat_context&);
# endif
#endif
```
It seems that what I'm asking for is already implemented but it's ifdef'd out
when compiling with -std=c++23 or higher.
I don't understand why "__cplusplus <= 202002L" is used.