Cleanup
This commit is contained in:
parent
f1ede6380b
commit
bb47109a78
@ -397,11 +397,6 @@ class container_buffer : public basic_buffer<typename Container::value_type> {
|
|||||||
container_(c) {}
|
container_(c) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// A helper function to suppress bogus "conditional expression is constant"
|
|
||||||
// warnings.
|
|
||||||
template <typename T>
|
|
||||||
inline T const_check(T value) { return value; }
|
|
||||||
|
|
||||||
struct error_handler {
|
struct error_handler {
|
||||||
FMT_CONSTEXPR error_handler() {}
|
FMT_CONSTEXPR error_handler() {}
|
||||||
FMT_CONSTEXPR error_handler(const error_handler &) {}
|
FMT_CONSTEXPR error_handler(const error_handler &) {}
|
||||||
@ -1136,9 +1131,9 @@ inline internal::named_arg<T, wchar_t> arg(wstring_view name, const T &arg) {
|
|||||||
template <typename S, typename T, typename Char>
|
template <typename S, typename T, typename Char>
|
||||||
void arg(S, internal::named_arg<T, Char>) FMT_DELETED;
|
void arg(S, internal::named_arg<T, Char>) 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
|
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);
|
fmt::print_colored(fmt::RED, "Elapsed time: {0:.2f} seconds", 1.23);
|
||||||
*/
|
*/
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
inline void print_colored(Color c, string_view format_str,
|
inline void print_colored(color c, string_view format_str,
|
||||||
const Args & ... args) {
|
const Args & ... args) {
|
||||||
vprint_colored(c, format_str, make_args(args...));
|
vprint_colored(c, format_str, make_args(args...));
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ FMT_FUNC void vprint(string_view format_str, format_args args) {
|
|||||||
vprint(stdout, format_str, 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";
|
char escape[] = "\x1b[30m";
|
||||||
escape[3] = static_cast<char>('0' + c);
|
escape[3] = static_cast<char>('0' + c);
|
||||||
std::fputs(escape, stdout);
|
std::fputs(escape, stdout);
|
||||||
|
@ -262,6 +262,11 @@ typename Allocator::value_type *allocate(Allocator& alloc, std::size_t n) {
|
|||||||
return alloc.allocate(n);
|
return alloc.allocate(n);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A helper function to suppress bogus "conditional expression is constant"
|
||||||
|
// warnings.
|
||||||
|
template <typename T>
|
||||||
|
inline T const_check(T value) { return value; }
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace fmt
|
} // namespace fmt
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user