Boost logo

Boost Users :

Subject: Re: [Boost-users] simple serialization of boost::variant
From: Stefan Strasser (strasser_at_[hidden])
Date: 2010-05-27 23:52:14


Zitat von Archie14 <admin_at_[hidden]>:

> I use std::istream and std::ostream for binary serialization ( can't use
> boost::serialization) and can't find a way to serialize boost::variant<int,
> double, std::string>. I'll appreciate a code sample or link to the
> documentation. Thanks.
>

boost/serialization/variant.hpp

you could either use that code, even though you're not using a archive
from Boost.Serialization, but it also shows how to serialize a
boost::variant if you want to write your own code (visitor for saving,
iteration for loading)


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