mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 06:21:00 +00:00
Workaround an internal compiler error in MSVC
This commit is contained in:
parent
c095445394
commit
232ceabbc3
@ -2506,11 +2506,11 @@ void basic_writer<Range>::write_double(T value, const format_specs &spec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto write_inf_or_nan = [this, &spec, sign](const char *str) {
|
auto write_inf_or_nan = [this, &spec, sign](const char *str) {
|
||||||
static constexpr std::size_t SIZE = 3;
|
enum {SIZE = 3}; // This is an enum to workaround a bug in MSVC.
|
||||||
write_padded(SIZE + (sign ? 1 : 0), spec, [sign, str](auto &it) {
|
write_padded(SIZE + (sign ? 1 : 0), spec, [sign, str](auto &it) {
|
||||||
if (sign)
|
if (sign)
|
||||||
*it++ = sign;
|
*it++ = sign;
|
||||||
it = std::uninitialized_copy_n(str, SIZE, it);
|
it = std::uninitialized_copy_n(str, static_cast<std::size_t>(SIZE), it);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user