Fix undefined reference when compiling with FMT_STATIC_THOUSANDS_SEPARATOR and chrono.h

This commit is contained in:
LoveSy 2024-06-04 21:59:53 +08:00 committed by Victor Zverovich
parent 6abc1204f3
commit 94f96d112d

View File

@ -1780,8 +1780,10 @@ class get_locale {
public:
get_locale(bool localized, locale_ref loc) : has_locale_(localized) {
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
if (localized)
::new (&locale_) std::locale(loc.template get<std::locale>());
#endif
}
~get_locale() {
if (has_locale_) locale_.~locale();