diff --git a/src/boost/locale/win32/numeric.cpp b/src/boost/locale/win32/numeric.cpp index 7cad035c..ea1b5ea5 100644 --- a/src/boost/locale/win32/numeric.cpp +++ b/src/boost/locale/win32/numeric.cpp @@ -130,27 +130,25 @@ namespace boost { namespace locale { namespace impl_win { template std::locale create_formatting_impl(const std::locale& in, const winlocale& lc) { + std::locale tmp(in, new num_format(lc)); if(lc.is_c()) { - std::locale tmp(in, new numpunct()); + tmp = std::locale(tmp, new numpunct()); tmp = std::locale(tmp, new std::time_put_byname("C")); - tmp = std::locale(tmp, new num_format(lc)); - return tmp; } else { - std::locale tmp(in, new num_punct_win(lc)); + tmp = std::locale(tmp, new num_punct_win(lc)); tmp = std::locale(tmp, new time_put_win(lc)); - tmp = std::locale(tmp, new num_format(lc)); - return tmp; } + return tmp; } template - std::locale create_parsing_impl(std::locale tmp, const winlocale& lc) + std::locale create_parsing_impl(const std::locale& in, const winlocale& lc) { + std::locale tmp(in, new util::base_num_parse()); if(lc.is_c()) tmp = std::locale(tmp, new numpunct()); else tmp = std::locale(tmp, new num_punct_win(lc)); - tmp = std::locale(tmp, new util::base_num_parse()); return tmp; }