-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide more overloads for the wide string flavour #867
Conversation
0575cac
to
996a8dc
Compare
Thanks for the PR, but we are trying to move from overloads to function templates in order to support more character types and reduce copy-paste. Please see Line 1376 in 894b6fa
|
Great - I totally love to see this happening! I've already changed my code with respect to the |
1d676f4
to
fa9c80a
Compare
@vitaut Victor, do you have an idea why gcc 4.8 is failing to compile the templated |
fa9c80a
to
265720b
Compare
gcc 4.8 is finicky. You need to explicitly construct |
include/fmt/color.h
Outdated
void vprint_rgb(rgb fd, rgb bg, string_view format, format_args args); | ||
namespace internal { | ||
FMT_CONSTEXPR_DECL const char FOREGROUND_COLOR[] = "\x1b[38;2;000;000;000m"; | ||
FMT_CONSTEXPR_DECL const char BACKGROUND_COLOR[] = "\x1b[48;2;000;000;000m"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should go to internal::data
. Also you don't need the 000;000;000m
part because you construct it in ansi_color_escape
.
include/fmt/color.h
Outdated
|
||
template <typename Char> | ||
struct ansi_color_escape { | ||
FMT_CONSTEXPR ansi_color_escape(rgb color, const char esc[]) FMT_NOEXCEPT { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: here and elsewhere const char []
-> const char *
include/fmt/color.h
Outdated
private: | ||
Char buffer[sizeof(FOREGROUND_COLOR)]; | ||
|
||
FMT_CONSTEXPR void to_esc(uint8_t c, Char out[], int offset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest getting rid of the offset
parameter and passing buffer pointer adjusted by offset instead.
265720b
to
9799def
Compare
@vitaut Thanks, Victor, for the tip regarding gcc 4.8 - it's happy now, too. I've incorporated the changes that you requested, as well. |
…' on the type of the format string. Signed-off-by: Daniela Engert <dani@ngrt.de>
9799def
to
27a34df
Compare
Signed-off-by: Daniela Engert dani@ngrt.de