Add missing moves to grouping std::string member (#4704)

This commit is contained in:
Aaron Gokaslan 2026-03-11 12:52:40 -04:00 committed by GitHub
parent 245e4d9723
commit c0cd0fcfec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1219,7 +1219,7 @@ FMT_API auto thousands_sep_impl(locale_ref loc) -> thousands_sep_result<Char>;
template <typename Char>
inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<Char> {
auto result = thousands_sep_impl<char>(loc);
return {result.grouping, Char(result.thousands_sep)};
return {std::move(result.grouping), Char(result.thousands_sep)};
}
template <>
inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<wchar_t> {
@ -1968,7 +1968,7 @@ template <typename Char> class digit_grouping {
explicit digit_grouping(locale_ref loc, bool localized = true) {
if (!localized) return;
auto sep = thousands_sep<Char>(loc);
grouping_ = sep.grouping;
grouping_ = std::move(sep.grouping);
if (sep.thousands_sep) thousands_sep_.assign(1, sep.thousands_sep);
}
digit_grouping(std::string grouping, std::basic_string<Char> sep)