Make copyfmt not throw (#1666)

This commit is contained in:
Victor Zverovich
2020-05-06 17:15:46 -07:00
parent 59fe455f36
commit 8f511fc12f
2 changed files with 17 additions and 5 deletions

View File

@@ -101,8 +101,8 @@ void format_value(buffer<Char>& buf, const T& value,
#if !defined(FMT_STATIC_THOUSANDS_SEPARATOR)
if (loc) output.imbue(loc.get<std::locale>());
#endif
output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
output << value;
output.exceptions(std::ios_base::failbit | std::ios_base::badbit);
buf.resize(buf.size());
}