22
General utilities library
[utilities]
22.14
Formatting
[format]
22.14.6
Formatter
[format.formatter]
22.14.6.2
Concept
formattable
[format.formattable]
1
#
Let
fmt-iter-for
<
charT
>
be an unspecified type that models
output_
iterator
<
const
charT
&
>
(
[iterator.
concept.
output]
)
.
template
<
class
T,
class
Context,
class
Formatter
=
typename
Context
::
template
formatter_type
<
remove_const_t
<
T
>
>
>
concept
formattable-with
=
//
exposition only
semiregular
<
Formatter
>
&
&
requires
(
Formatter
&
f,
const
Formatter
&
cf, T
&
&
t, Context fc, basic_format_parse_context
<
typename
Context
::
char_type
>
pc
)
{
{
f
.
parse
(
pc
)
}
-
>
same_
as
<
typename
decltype
(
pc
)
::
iterator
>
;
{
cf
.
format
(
t, fc
)
}
-
>
same_
as
<
typename
Context
::
iterator
>
;
}
;
template
<
class
T,
class
charT
>
concept
formattable
=
formattable-with
<
remove_reference_t
<
T
>
, basic_format_context
<
fmt-iter-for
<
charT
>
>
>
;
2
#
A type
T
and a character type
charT
model
formattable
if
formatter
<
remove_
cvref_
t
<
T
>
, charT
>
meets the
BasicFormatter
requirements (
[formatter.
requirements]
) and, if
remove_
reference_
t
<
T
>
is const-qualified, the
Formatter
requirements
.