2.2 KiB
[format.formattable]
28 Text processing library [text]
28.5 Formatting [format]
28.5.6 Formatter [format.formatter]
28.5.6.3 Concept formattable [format.formattable]
Let fmt-iter-for be an unspecified type that modelsoutput_iterator<const charT&> ([iterator.concept.output]).
template<class T, class Context, class Formatter = typename Context::template formatter_type<remove_const_t>>concept formattable-with = // exposition onlysemiregular &&requires(Formatter& f, const Formatter& cf, T&& t, Context fc, basic_format_parse_context pc){{ f.parse(pc) } -> same_as<typename decltype(pc)::iterator>; { cf.format(t, fc) } -> same_as; };
template<class T, class charT>concept formattable =formattable-with<remove_reference_t, basic_format_context<fmt-iter-for, charT>>;
A type T and a character type charT model formattable if formatter<remove_cvref_t, charT> meets the BasicFormatter requirements ([formatter.requirements]) and, if remove_reference_t is const-qualified, the Formatter requirements.