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

I have this class for example

class Object
{
public:

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

private:

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 ?