diff --git a/include/fmt/core.h b/include/fmt/core.h index 0d1b5523..42839277 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1416,8 +1416,9 @@ typename buffer_context::type::iterator vformat_to( fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); \endrst */ -template ::value)> +template inline internal::named_arg arg(const S& name, const T& arg) { + static_assert(internal::is_string::value, ""); return {name, arg}; } @@ -1472,6 +1473,7 @@ inline std::basic_string vformat( std::string message = fmt::format("The answer is {}", 42); \endrst */ +// Use SFINAE instead of static_assert because of color overload of fmt::format. template ::value)> inline std::basic_string format(const S& format_str,