Boost logo

Boost Users :

Subject: Re: [Boost-users] How to serialize basic_string<unsigned char>
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-04-10 13:00:06


Martin Dietze wrote:
> I want to serialize an existing (low level) class which
> uses a `std::basic_string<unsigned char>' as member variable.
> Compiling the code (boost/serialization/string.hpp is included)
> fails with this message:
>
> /usr/include/boost/serialization/access.hpp:109: error: 'class
> std::basic_string<unsigned char, std::char_traits<unsigned char>,
> std::allocator<unsigned char> >' has no member named 'serialize'
>
> As I understand, std::string is now treated as a simple data
> type, but std:basic_string<unsigned char> is not. Is there
> already existing support for such instanciations of
> std::basic_string? Any hint on what I can do to get this
> working?

Just look at boost/serialization/string.hpp and do the same thing
for unsigned char

Robert Ramey


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net