Boost C++ Libraries: Ticket #9253: Support for serializing std::u16string https://svn.boost.org/trac10/ticket/9253 <p> Hi: I would like to use the boot serialization library with the C++11 std::u16string type. When I use it with a text archive I get the following error. Could you elaborate on the plans by when we will be having support for this. For now, we can get workaround the issue by writing our own non-intrusive "load" and "save" methods for u16string, but would prefer built in serialization support for it like std::string. </p> <p> Please find below the stack trace for the error. </p> <p> Thanks </p> <p> boost/include/boost/serialization/access.hpp: In instantiation of 'static void boost::serialization::access::serialize(Archive&amp;, T&amp;, unsigned int) [with Archive = boost::archive::text_oarchive; T = std::basic_string&lt;char16_t&gt;]': boost/include/boost/serialization/serialization.hpp:102:5: required from 'void boost::serialization::serialize(Archive&amp;, T&amp;, unsigned int) [with Archive = boost::archive::text_oarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/serialization/serialization.hpp:161:9: required from 'void boost::serialization::serialize_adl(Archive&amp;, T&amp;, unsigned int) [with Archive = boost::archive::text_oarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/archive/detail/oserializer.hpp:148:5: required from 'void boost::archive::detail::oserializer&lt;Archive, T&gt;::save_object_data(boost::archive::detail::basic_oarchive&amp;, const void*) const [with Archive = boost::archive::text_oarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/archive/detail/oserializer.hpp:101:1: required from 'class boost::archive::detail::oserializer&lt;boost::archive::text_oarchive, std::basic_string&lt;char16_t&gt; &gt;' boost/include/boost/archive/detail/oserializer.hpp:253:13: required from 'static void boost::archive::detail::save_non_pointer_type&lt;Archive&gt;::save_standard::invoke(Archive&amp;, const T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_oarchive]' boost/include/boost/archive/detail/oserializer.hpp:308:9: required from 'static void boost::archive::detail::save_non_pointer_type&lt;Archive&gt;::invoke(Archive&amp;, const T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_oarchive]' boost/include/boost/archive/detail/oserializer.hpp:314:9: required from 'static void boost::archive::detail::save_non_pointer_type&lt;Archive&gt;::invoke(Archive&amp;, T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_oarchive]' boost/include/boost/archive/detail/oserializer.hpp:525:5: required from 'void boost::archive::save(Archive&amp;, T&amp;) [with Archive = boost::archive::text_oarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/archive/detail/common_oarchive.hpp:69:9: required from 'void boost::archive::detail::common_oarchive&lt;Archive&gt;::save_override(T&amp;, int) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_oarchive]' boost/include/boost/archive/basic_text_oarchive.hpp:113:9: required from 'void boost::archive::basic_text_oarchive&lt;Archive&gt;::save_override(T&amp;, int) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_oarchive]' boost/include/boost/archive/detail/interface_oarchive.hpp:63:9: required from 'Archive&amp; boost::archive::detail::interface_oarchive&lt;Archive&gt;::operator&lt;&lt;(T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_oarchive]' main.cpp:39:15: required from here </p> <p> boost/include/boost/serialization/access.hpp:151:9: error: 'class std::basic_string&lt;char16_t&gt;' has no member named 'serialize' boost/include/boost/serialization/access.hpp: In instantiation of 'static void boost::serialization::access::serialize(Archive&amp;, T&amp;, unsigned int) [with Archive = boost::archive::text_iarchive; T = std::basic_string&lt;char16_t&gt;]': boost/include/boost/serialization/serialization.hpp:102:5: required from 'void boost::serialization::serialize(Archive&amp;, T&amp;, unsigned int) [with Archive = boost::archive::text_iarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/serialization/serialization.hpp:161:9: required from 'void boost::serialization::serialize_adl(Archive&amp;, T&amp;, unsigned int) [with Archive = boost::archive::text_iarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/archive/detail/iserializer.hpp:188:5: required from 'void boost::archive::detail::iserializer&lt;Archive, T&gt;::load_object_data(boost::archive::detail::basic_iarchive&amp;, void*, unsigned int) const [with Archive = boost::archive::text_iarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/archive/detail/iserializer.hpp:120:1: required from 'class boost::archive::detail::iserializer&lt;boost::archive::text_iarchive, std::basic_string&lt;char16_t&gt; &gt;' boost/include/boost/archive/detail/iserializer.hpp:387:13: required from 'static void boost::archive::detail::load_non_pointer_type&lt;Archive&gt;::load_standard::invoke(Archive&amp;, const T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_iarchive]' boost/include/boost/archive/detail/iserializer.hpp:439:9: required from 'static void boost::archive::detail::load_non_pointer_type&lt;Archive&gt;::invoke(Archive&amp;, T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_iarchive]' boost/include/boost/archive/detail/iserializer.hpp:592:5: required from 'void boost::archive::load(Archive&amp;, T&amp;) [with Archive = boost::archive::text_iarchive; T = std::basic_string&lt;char16_t&gt;]' boost/include/boost/archive/detail/common_iarchive.hpp:66:9: required from 'void boost::archive::detail::common_iarchive&lt;Archive&gt;::load_override(T&amp;, int) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_iarchive]' boost/include/boost/archive/basic_text_iarchive.hpp:98:9: required from 'void boost::archive::basic_text_iarchive&lt;Archive&gt;::load_override(T&amp;, int) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_iarchive]' boost/include/boost/archive/text_iarchive.hpp:115:9: required from 'void boost::archive::text_iarchive_impl&lt;Archive&gt;::load_override(T&amp;, int) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_iarchive]' boost/include/boost/archive/detail/interface_iarchive.hpp:60:9: required from 'Archive&amp; boost::archive::detail::interface_iarchive&lt;Archive&gt;::operator&gt;&gt;(T&amp;) [with T = std::basic_string&lt;char16_t&gt;; Archive = boost::archive::text_iarchive]' main.cpp:55:15: required from here boost/include/boost/serialization/access.hpp:151:9: error: 'class std::basic_string&lt;char16_t&gt;' has no member named 'serialize' </p> <p> Thanks </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9253 Trac 1.4.3 Robert Ramey Tue, 04 Feb 2014 01:26:01 GMT <link>https://svn.boost.org/trac10/ticket/9253#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9253#comment:1</guid> <description> <p> how about attaching your own implementation so I can see what it looks like </p> </description> <category>Ticket</category> </item> </channel> </rss>