Boost logo

Boost Users :

Subject: [Boost-users] [serialization] serialization of an ifstream/ofstream class member
From: Pablo Madoery (madoerypablo_at_[hidden])
Date: 2014-03-28 09:09:44

Hi. Do You know if there is a way to serialize an ifstream/ofstream class

I have this class for example

class Object

Object(string name);
virtual ~Object();
string getName() const;


string name_;
ifstream file_;

friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
ar & name_;
ar & file_;

when I try to serialize it throw compilation error :
error: 'struct std::basic_ifstream<char>' has no member named 'serialize'.

Is there a specific header i must include ?

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