|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2006-02-22 10:49:54
Have you included
#include <boost/serialization/string.hpp>
?
Michael Sperber wrote:
> Hi there,
>
> I'm trying to convert a piece of code from templated archives to
> polymorphic ones, and am running into trouble when serializing
> std::string. Either I get an error message saying that std::string
> has no serialize member function, or I get the attached message.
>
> The relevant code is this:
>
> ---snip---
> #include <boost/serialization/serialization.hpp>
>
> #include <boost/archive/polymorphic_iarchive.hpp>
> #include <boost/archive/polymorphic_oarchive.hpp>
>
> void
> mtime::serialize(boost::archive::polymorphic_iarchive& ar,
> const unsigned int file_version)
> {
> std::string iso;
> ar & boost::serialization::make_nvp("iso_time", iso);
> set_from_iso_string(iso);
> }
>
> void
> mtime::serialize(boost::archive::polymorphic_oarchive& ar,
> const unsigned int file_version)
> {
> std::string iso =3D to_iso_string();
> ar & boost::serialization::make_nvp("iso_time", iso);
> }
> ---snip---
>
> Am I missing something obvious? Are certain types not directly
> supported for serialization via polymorphic archives? Any help would
> be much appreciated.
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