30#ifndef _GLIBCXX_FORMAT_FWD_H
31#define _GLIBCXX_FORMAT_FWD_H 1
34#pragma GCC system_header
38#ifdef __glibcxx_format
42#if __glibcxx_format_ranges
46namespace std _GLIBCXX_VISIBILITY(default)
48_GLIBCXX_BEGIN_NAMESPACE_VERSION
51 template<
typename _Out,
typename _CharT>
class basic_format_context;
54 template<
typename _CharT>
class basic_format_parse_context;
57 template<
typename _Tp,
typename _CharT =
char>
struct formatter;
62#ifdef _GLIBCXX_USE_WCHAR_T
63 template<
typename _CharT>
64 concept __char = same_as<_CharT, char> || same_as<_CharT, wchar_t>;
66 template<
typename _CharT>
67 concept __char = same_as<_CharT, char>;
70 enum class _Align :
unsigned char {
78 template<
typename _CharT>
struct _Spec;
80 template<__
char _CharT>
struct __formatter_str;
81 template<__
char _CharT>
struct __formatter_int;
82 template<__
char _CharT>
struct __formatter_ptr;
84 template<
typename _Tp,
typename _Context,
86 =
typename _Context::template formatter_type<remove_const_t<_Tp>>,
87 typename _ParseContext
88 = basic_format_parse_context<typename _Context::char_type>>
89 concept __parsable_with
90 = semiregular<_Formatter>
91 &&
requires (_Formatter __f, _ParseContext __pc)
93 { __f.parse(__pc) } -> same_as<typename _ParseContext::iterator>;
96 template<
typename _Tp,
typename _Context,
98 =
typename _Context::template formatter_type<remove_const_t<_Tp>>,
99 typename _ParseContext
100 = basic_format_parse_context<typename _Context::char_type>>
101 concept __formattable_with
102 = semiregular<_Formatter>
103 &&
requires (
const _Formatter __cf, _Tp&& __t, _Context __fc)
105 { __cf.format(__t, __fc) } -> same_as<typename _Context::iterator>;
109 template<
typename _CharT>
111 template<
typename _CharT>
112 using _Iter_for_t =
typename _Iter_for<_CharT>::type;
114 template<
typename _Tp,
typename _CharT,
115 typename _Context = basic_format_context<_Iter_for_t<_CharT>, _CharT>>
116 concept __formattable_impl
117 = __parsable_with<_Tp, _Context> && __formattable_with<_Tp, _Context>;
119 template<
typename _Formatter>
120 concept __has_debug_format =
requires(_Formatter __f)
122 __f.set_debug_format();
127#if __glibcxx_format_ranges
129 template<
typename _Tp,
typename _CharT>
131 = __format::__formattable_impl<remove_reference_t<_Tp>, _CharT>;
133 template<
typename _Tp, __format::__
char _CharT =
char>
135 class range_formatter;
140 template<
typename _Rg,
typename _CharT>
141 concept __const_formattable_range
142 = ranges::input_range<const _Rg>
143 && formattable<ranges::range_reference_t<const _Rg>, _CharT>;
147 template<
typename _Rg,
typename _CharT>
148 concept __simply_formattable_range
149 = __const_formattable_range<_Rg, _CharT>
150 && same_as<remove_cvref_t<ranges::range_reference_t<_Rg>>,
151 remove_cvref_t<ranges::range_reference_t<const _Rg>>>;
153 template<
typename _Rg,
typename _CharT>
154 using __maybe_const_range
155 = __conditional_t<__const_formattable_range<_Rg, _CharT>,
const _Rg, _Rg>;
157 template<
typename _Tp,
typename _CharT>
159 = __conditional_t<formattable<const _Tp, _CharT>,
const _Tp, _Tp>;
164 enum class range_format {
182 template<
typename _Rg>
183 constexpr auto format_kind = []{
184 static_assert(
false,
"cannot use primary template of 'std::format_kind'");
185 return type_identity<_Rg>{};
189#if __glibcxx_print >= 202403L
191 constexpr bool enable_nonlocking_formatter_optimization =
false;
194_GLIBCXX_END_NAMESPACE_VERSION
basic_string< char > string
A string of char.
ISO C++ entities toplevel namespace is std.
A standard container made up of (key,value) pairs, which can be retrieved based on a key,...
A standard container made up of unique keys, which can be retrieved in logarithmic time.
[concept.same], concept same_as