Boost logo

Boost Users :

Subject: [Boost-users] Boost Serialization - Overriding builtin implementation for std::wstring
From: cpp_learner (learner.cpp_at_[hidden])
Date: 2014-12-04 17:58:45

The current serialization implementation for std::wstring is not portable
across platforms. To make it cross platform, we would like to customize the
serialization implementation for std::wstring (by splitting "serialize" and
providing our own implementation for "save/load"). Is it possible to
achieve this?

One way to get around this is to provide our own implementation, and not
include the header boost/serialization/string.hpp. This is not an option
to us as there is no way for us to enforce clients to not include this
header at all either directly or indirectly. And unfortunately, the
compiler does not complain if the same compilation unit has two different
serialization mechanism for std::wstring (the builtin and customized
serialization implementation, in which case the builtin serialization
implementation is picked, which is not portable).

Many Thanks

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at