@@ -190,11 +190,11 @@ enum class emphasis : uint8_t {
190
190
// rgb is a struct for red, green and blue colors.
191
191
// Using the name "rgb" makes some editors show the color in a tooltip.
192
192
struct rgb {
193
- FMT_CONSTEXPR rgb () : r(0 ), g(0 ), b(0 ) {}
194
- FMT_CONSTEXPR rgb (uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {}
195
- FMT_CONSTEXPR rgb (uint32_t hex)
193
+ constexpr rgb () : r(0 ), g(0 ), b(0 ) {}
194
+ constexpr rgb (uint8_t r_, uint8_t g_, uint8_t b_) : r(r_), g(g_), b(b_) {}
195
+ constexpr rgb (uint32_t hex)
196
196
: r((hex >> 16 ) & 0xFF), g((hex >> 8 ) & 0xFF), b(hex & 0xFF ) {}
197
- FMT_CONSTEXPR rgb (color hex)
197
+ constexpr rgb (color hex)
198
198
: r((uint32_t (hex) >> 16) & 0xFF),
199
199
g((uint32_t (hex) >> 8) & 0xFF),
200
200
b(uint32_t (hex) & 0xFF) {}
@@ -205,30 +205,30 @@ struct rgb {
205
205
206
206
namespace detail {
207
207
208
- // a bit-packed variant of an RGB color, a terminal color, or unset color.
208
+ // A bit-packed variant of an RGB color, a terminal color, or unset color.
209
209
// see text_style for the bit-packing scheme.
210
210
struct color_type {
211
- FMT_CONSTEXPR color_type () noexcept = default;
212
- FMT_CONSTEXPR color_type (color rgb_color) noexcept
211
+ constexpr color_type () noexcept = default;
212
+ constexpr color_type (color rgb_color) noexcept
213
213
: value_(static_cast <uint32_t >(rgb_color) | (1 << 24 )) {}
214
- FMT_CONSTEXPR color_type (rgb rgb_color) noexcept
214
+ constexpr color_type (rgb rgb_color) noexcept
215
215
: color_type(static_cast <color>(
216
216
(static_cast <uint32_t >(rgb_color.r) << 16) |
217
217
(static_cast <uint32_t >(rgb_color.g) << 8) | rgb_color.b)) {}
218
- FMT_CONSTEXPR color_type (terminal_color term_color) noexcept
218
+ constexpr color_type (terminal_color term_color) noexcept
219
219
: value_(static_cast <uint32_t >(term_color) | (3 << 24 )) {}
220
220
221
- FMT_CONSTEXPR auto is_terminal_color () const noexcept -> bool {
221
+ constexpr auto is_terminal_color () const noexcept -> bool {
222
222
return (value_ & (1 << 25 )) != 0 ;
223
223
}
224
224
225
- FMT_CONSTEXPR auto value () const noexcept -> uint32_t {
225
+ constexpr auto value () const noexcept -> uint32_t {
226
226
return value_ & 0xFFFFFF ;
227
227
}
228
228
229
- FMT_CONSTEXPR color_type (uint32_t value) noexcept : value_(value) {}
229
+ constexpr color_type (uint32_t value) noexcept : value_(value) {}
230
230
231
- uint32_t value_{} ;
231
+ uint32_t value_ = 0 ;
232
232
};
233
233
} // namespace detail
234
234
@@ -341,7 +341,7 @@ class text_style {
341
341
friend FMT_CONSTEXPR auto bg (detail::color_type background) noexcept
342
342
-> text_style;
343
343
344
- uint64_t style_{} ;
344
+ uint64_t style_ = 0 ;
345
345
};
346
346
347
347
// / Creates a text style from the foreground (text) color.
@@ -490,7 +490,7 @@ void vformat_to(buffer<Char>& buf, text_style ts, basic_string_view<Char> fmt,
490
490
buf.append (background.begin (), background.end ());
491
491
}
492
492
vformat_to (buf, fmt, args);
493
- if (ts != text_style{} ) reset_color<Char>(buf);
493
+ if (ts != text_style () ) reset_color<Char>(buf);
494
494
}
495
495
} // namespace detail
496
496
0 commit comments