Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-01-14 10:28:48

In a project of mine we plan to store some number of objects into an archive
and later load them. The problem is that the number of objects is not known
when you're writing an archive, so when reading, you don't know where to

I wonder if the following code will work:

   ifstream ifs(...);
   boost::binary_iarchive ia(ifs);

   while(ifs) {
       some_object obj;
       ia >> obj;

The problem is that I don't know what archive will do on stream errors. For
the above to work, it should stop doing anything. But I can't find any
documentation about what happens -- I think it's better to discuss and
document that.

- Volodya

Boost list run by bdawes at, gregod at, cpdaniel at, john at