mirror of
https://github.com/HowardHinnant/date.git
synced 2025-07-30 02:37:13 +02:00
Fix operator<< for years with non C locale
Fix the issue https://github.com/HowardHinnant/date/issues/392
This commit is contained in:
committed by
Howard Hinnant
parent
6f0b645df1
commit
09d90a8b5e
@ -1722,6 +1722,7 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const year& y)
|
||||
os.fill('0');
|
||||
os.flags(std::ios::dec | std::ios::internal);
|
||||
os.width(4 + (y < year{0}));
|
||||
os.imbue(std::locale::classic());
|
||||
os << static_cast<int>(y);
|
||||
if (!y.ok())
|
||||
os << " is not a valid year";
|
||||
|
Reference in New Issue
Block a user