explicit capture to avoid MACRO
This commit is contained in:
parent
9f8cacb8a4
commit
393fd86ab9
@ -172,12 +172,6 @@ FMT_END_NAMESPACE
|
||||
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
||||
#endif
|
||||
|
||||
#if (__cplusplus > 201703L)
|
||||
# define FMT_CAPTURE_THIS , this
|
||||
#else
|
||||
# define FMT_CAPTURE_THIS
|
||||
#endif
|
||||
|
||||
// Some compilers masquerade as both MSVC and GCC-likes or otherwise support
|
||||
// __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the
|
||||
// MSVC intrinsics if the clz and clzll builtins are not available.
|
||||
@ -1474,7 +1468,7 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
||||
void on_dec() {
|
||||
auto num_digits = count_digits(abs_value);
|
||||
out = write_int(out, num_digits, get_prefix(), specs,
|
||||
[= FMT_CAPTURE_THIS](iterator it) {
|
||||
[this, num_digits](iterator it) {
|
||||
return format_decimal<Char>(it, abs_value, num_digits);
|
||||
});
|
||||
}
|
||||
@ -1486,7 +1480,7 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
||||
}
|
||||
int num_digits = count_digits<4>(abs_value);
|
||||
out = write_int(out, num_digits, get_prefix(), specs,
|
||||
[= FMT_CAPTURE_THIS](iterator it) {
|
||||
[this, num_digits](iterator it) {
|
||||
return format_uint<4, Char>(it, abs_value, num_digits,
|
||||
specs.type != 'x');
|
||||
});
|
||||
@ -1499,7 +1493,7 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
||||
}
|
||||
int num_digits = count_digits<1>(abs_value);
|
||||
out = write_int(out, num_digits, get_prefix(), specs,
|
||||
[= FMT_CAPTURE_THIS](iterator it) {
|
||||
[this, num_digits](iterator it) {
|
||||
return format_uint<1, Char>(it, abs_value, num_digits);
|
||||
});
|
||||
}
|
||||
@ -1512,7 +1506,7 @@ template <typename OutputIt, typename Char, typename UInt> struct int_writer {
|
||||
prefix[prefix_size++] = '0';
|
||||
}
|
||||
out = write_int(out, num_digits, get_prefix(), specs,
|
||||
[= FMT_CAPTURE_THIS](iterator it) {
|
||||
[this, num_digits](iterator it) {
|
||||
return format_uint<3, Char>(it, abs_value, num_digits);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user