Workaround an internal compiler error in MSVC

This commit is contained in:
Victor Zverovich 2018-01-13 05:52:30 -08:00
parent c095445394
commit 232ceabbc3

View File

@ -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) {
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) {
if (sign)
*it++ = sign;
it = std::uninitialized_copy_n(str, SIZE, it);
it = std::uninitialized_copy_n(str, static_cast<std::size_t>(SIZE), it);
});
};