diff --git a/include/fmt/core.h b/include/fmt/core.h index a054f9769830..e204ae00d19d 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -340,9 +340,22 @@ class basic_format_arg; template class basic_format_args; +template +struct no_formatter_error : std::false_type {}; + // A formatter for objects of type T. template -struct formatter; +struct formatter { + static_assert(no_formatter_error::value, + "don't know how to format the type, include fmt/ostream.h if it provides " + "an operator<< that should be used"); + + // The following functions are not defined intentionally. + template + typename ParseContext::iterator parse(ParseContext &); + template + auto format(const T &val, FormatContext &ctx) -> decltype(ctx.out()); +}; template struct convert_to_int {