@@ -130,27 +130,25 @@ namespace boost { namespace locale { namespace impl_win {
130130 template <typename CharType>
131131 std::locale create_formatting_impl (const std::locale& in, const winlocale& lc)
132132 {
133+ std::locale tmp (in, new num_format<CharType>(lc));
133134 if (lc.is_c ()) {
134- std::locale tmp (in , new numpunct<CharType>());
135+ tmp = std::locale (tmp , new numpunct<CharType>());
135136 tmp = std::locale (tmp, new std::time_put_byname<CharType>(" C" ));
136- tmp = std::locale (tmp, new num_format<CharType>(lc));
137- return tmp;
138137 } else {
139- std::locale tmp (in , new num_punct_win<CharType>(lc));
138+ tmp = std::locale (tmp , new num_punct_win<CharType>(lc));
140139 tmp = std::locale (tmp, new time_put_win<CharType>(lc));
141- tmp = std::locale (tmp, new num_format<CharType>(lc));
142- return tmp;
143140 }
141+ return tmp;
144142 }
145143
146144 template <typename CharType>
147- std::locale create_parsing_impl (std::locale tmp , const winlocale& lc)
145+ std::locale create_parsing_impl (const std::locale& in , const winlocale& lc)
148146 {
147+ std::locale tmp (in, new util::base_num_parse<CharType>());
149148 if (lc.is_c ())
150149 tmp = std::locale (tmp, new numpunct<CharType>());
151150 else
152151 tmp = std::locale (tmp, new num_punct_win<CharType>(lc));
153- tmp = std::locale (tmp, new util::base_num_parse<CharType>());
154152 return tmp;
155153 }
156154
0 commit comments