diff --git a/include/fmt/core.h b/include/fmt/core.h index 7bc20af0..e9cea570 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1352,10 +1352,9 @@ template ::value)> void check_format_string(S); -template < - typename S, typename... Args, - typename Char = enable_if_t::value, fmt::char_t>> -inline format_arg_store::type, Args...> +template ::value)> +inline format_arg_store::type, Args...> make_args_checked(const S& format_str, const Args&... args) { internal::check_format_string(format_str); return {args...}; @@ -1387,8 +1386,8 @@ typename buffer_context::type::iterator vformat_to( fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); \endrst */ -template > -inline internal::named_arg arg(const S& name, const T& arg) { +template +inline internal::named_arg arg(const S& name, const T& arg) { static_assert(internal::is_string::value, ""); return {name, arg}; } @@ -1406,12 +1405,11 @@ template struct is_contiguous> : std::true_type {}; /** Formats a string and writes the output to ``out``. */ -template < - typename Container, typename S, - typename Char = enable_if_t::value, char_t>> -std::back_insert_iterator vformat_to( - std::back_insert_iterator out, const S& format_str, - basic_format_args::type> args) { +template +typename std::enable_if::value, + std::back_insert_iterator>::type +vformat_to(std::back_insert_iterator out, const S& format_str, + basic_format_args::type> args) { internal::container_buffer buf(internal::get_container(out)); internal::vformat_to(buf, to_string_view(format_str), args); return out; @@ -1427,8 +1425,8 @@ inline std::back_insert_iterator format_to( {internal::make_args_checked(format_str, args...)}); } -template ::value, char_t>> +template ::value)> inline std::basic_string vformat( const S& format_str, basic_format_args::type> args) { @@ -1449,8 +1447,7 @@ inline std::basic_string vformat( // std::basic_string> to reduce the symbol size. template ::value, char_t>> -inline std::basic_string format(const S& format_str, - const Args&... args) { +inline std::basic_string format(const S& format_str, const Args&... args) { return internal::vformat(to_string_view(format_str), {internal::make_args_checked(format_str, args...)}); }