summaryrefslogtreecommitdiff
path: root/boost/archive/basic_text_oprimitive.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/archive/basic_text_oprimitive.hpp')
-rw-r--r--boost/archive/basic_text_oprimitive.hpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/boost/archive/basic_text_oprimitive.hpp b/boost/archive/basic_text_oprimitive.hpp
index 86330921d2..c9f8c59160 100644
--- a/boost/archive/basic_text_oprimitive.hpp
+++ b/boost/archive/basic_text_oprimitive.hpp
@@ -26,14 +26,13 @@
#include <iomanip>
#include <locale>
-#include <boost/assert.hpp>
#include <cstddef> // size_t
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
-#include <boost/detail/workaround.hpp>
#include <boost/io/ios_state.hpp>
+#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/archive/dinkumware.hpp>
#endif
@@ -52,10 +51,10 @@ namespace std{
#include <boost/limits.hpp>
#include <boost/integer.hpp>
#include <boost/io/ios_state.hpp>
-#include <boost/scoped_ptr.hpp>
#include <boost/serialization/throw_exception.hpp>
-#include <boost/archive/archive_exception.hpp>
#include <boost/archive/basic_streambuf_locale_saver.hpp>
+#include <boost/archive/codecvt_null.hpp>
+#include <boost/archive/archive_exception.hpp>
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
namespace boost {
@@ -72,9 +71,17 @@ protected:
io::ios_precision_saver precision_saver;
#ifndef BOOST_NO_STD_LOCALE
- boost::scoped_ptr<std::locale> archive_locale;
- basic_streambuf_locale_saver<
- typename OStream::char_type,
+ // note order! - if you change this, libstd++ will fail!
+ // a) create new locale with new codecvt facet
+ // b) save current locale
+ // c) change locale to new one
+ // d) use stream buffer
+ // e) change locale back to original
+ // f) destroy new codecvt facet
+ boost::archive::codecvt_null<typename OStream::char_type> codecvt_null_facet;
+ std::locale archive_locale;
+ basic_ostream_locale_saver<
+ typename OStream::char_type,
typename OStream::traits_type
> locale_saver;
#endif