On Fri, Nov 19, 2010 at 12:55 PM, Jeff Flinn <TriumphSprint2000@hotmail.com> wrote:
James C. Sutherland wrote:
It appears that the operator == is not supported on an archive.

Is there a way to compare two archives for equality without instantiating all objects in the archive and looking at equality of the objects?

Wouldn't you just compare the underlying storage of the archived data? Such as the resulting file, or string from a ostringstream.

Not sure what your are trying to accomplish.


Really I just want to compare two archives that I have read in for equality.

      ifstream file1( tname1.c_str(), std::ios_base::in );
      InputArchive ar1(file1);
      ar1 >> BOOST_SERIALIZATION_NVP(tbl1);

      ifstream file2( tname2.c_str(), std::ios_base::in );
      InputArchive ar2(file2);
      ar2 >> BOOST_SERIALIZATION_NVP(tbl2);

So at this point I could compare file1 and file2 or ar1 ar2 or tbl1 and tbl2.
Comparing equality on tbl1 and tbl2 is a bit tedious, so if I could directly compare either the files or the archives that would help.

Hopefully that clarifies my question.

James