diff --git a/include/fmt/format.h b/include/fmt/format.h index 8525639e..7bf9ca62 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3566,14 +3566,17 @@ namespace internal { # if FMT_USE_UDL_TEMPLATE template class udl_formatter { - public: template + FMT_CONSTEXPR11 static bool is_valid() { + return do_check_format_string( + basic_string_view( + std::initializer_list{CHARS...}.begin(), + sizeof...(CHARS))); + } + public: + template ())> std::basic_string operator()(const Args&... args) const { FMT_CONSTEXPR_DECL Char s[] = {CHARS..., '\0'}; - FMT_CONSTEXPR_DECL bool invalid_format = - do_check_format_string( - basic_string_view(s, sizeof...(CHARS))); - (void)invalid_format; return format(s, args...); } };