From 2833c76f223289a9de47c64d0c29a21a9d81ba7e Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 1 Jun 2019 12:14:27 -0700 Subject: [PATCH] Move char_t to template param to reduce symbol size --- include/fmt/core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 6e73481f..e9cea570 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1443,11 +1443,11 @@ 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. +// Pass fmt::char_t as a default template parameter instead of using +// std::basic_string> to reduce the symbol size. template ::value)> -inline std::basic_string format(const S& format_str, - const Args&... args) { + typename Char = enable_if_t::value, char_t>> +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...)}); }