diff --git a/include/fmt/core.h b/include/fmt/core.h index 166447b1..e11a8986 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -397,11 +397,6 @@ class container_buffer : public basic_buffer { container_(c) {} }; -// A helper function to suppress bogus "conditional expression is constant" -// warnings. -template -inline T const_check(T value) { return value; } - struct error_handler { FMT_CONSTEXPR error_handler() {} FMT_CONSTEXPR error_handler(const error_handler &) {} @@ -1136,9 +1131,9 @@ inline internal::named_arg arg(wstring_view name, const T &arg) { template void arg(S, internal::named_arg) FMT_DELETED; -enum Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE }; +enum color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE }; -FMT_API void vprint_colored(Color c, string_view format, format_args args); +FMT_API void vprint_colored(color c, string_view format, format_args args); /** Formats a string and prints it to stdout using ANSI escape sequences to @@ -1147,7 +1142,7 @@ FMT_API void vprint_colored(Color c, string_view format, format_args args); fmt::print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23); */ template -inline void print_colored(Color c, string_view format_str, +inline void print_colored(color c, string_view format_str, const Args & ... args) { vprint_colored(c, format_str, make_args(args...)); } diff --git a/include/fmt/format.cc b/include/fmt/format.cc index 0e7abb23..cff18aad 100644 --- a/include/fmt/format.cc +++ b/include/fmt/format.cc @@ -414,7 +414,7 @@ FMT_FUNC void vprint(string_view format_str, format_args args) { vprint(stdout, format_str, args); } -FMT_FUNC void vprint_colored(Color c, string_view format, format_args args) { +FMT_FUNC void vprint_colored(color c, string_view format, format_args args) { char escape[] = "\x1b[30m"; escape[3] = static_cast('0' + c); std::fputs(escape, stdout); diff --git a/include/fmt/format.h b/include/fmt/format.h index d85d7f7b..2ec2f889 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -262,6 +262,11 @@ typename Allocator::value_type *allocate(Allocator& alloc, std::size_t n) { return alloc.allocate(n); #endif } + +// A helper function to suppress bogus "conditional expression is constant" +// warnings. +template +inline T const_check(T value) { return value; } } // namespace internal } // namespace fmt