std::formattable

Header: <format>

The concept formattable specifies that std::formatter<std::remove_cvref_t, CharT> meets the requirements of BasicFormatter and Formatter (if std::remove_reference_t is const-qualified).

# Declarations

template< class T, class CharT >
concept formattable = /* formattable_with */<
std::remove_reference_t<T>,
std::basic_format_context</* fmt_iter_for */<CharT>, CharT>
>;

(since C++23)

Helper templates
template< class CharT >
using /* fmt_iter_for */ = /* unspecified */;

(exposition only*)

template< class T, class Context,
class Formatter =
typename Context::template
formatter_type<std::remove_const_t<T>> >
concept /* formattable_with */ =
std::semiregular<Formatter> &&
requires (Formatter& f, const Formatter& cf, T&& t, Context fc,
std::basic_format_parse_context<
typename Context::char_type
> pc) {
{ f.parse(pc) } -> std::same_as<typename decltype(pc)::iterator>;
{ cf.format(t, fc) } -> std::same_as<typename Context::iterator>;
};

(exposition only*)

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 3925C++23the second template argument of std::basic_format_context was not providedprovided

# See also