Bill Lear:
I think something simpler would be to have a single callback, say progress(), and pass it the number of bytes read so far from the stream in question. This would allow a percentage complete calculation to be done based on the number of bytes in the incoming file (assuming it is not compressed). Thus, something like this:
template<class Archive> void serialize(Archive & ar, E & e, const unsigned int version){ ar & e; progress(ar.stream().tellg()); }
template<class Archive> void serialize(Archive & ar, B & b, const unsigned int version){ ar & b; progress(ar.stream().tellg()); }
or whatever.
It's better to implement the progress callback at the streambuf level, the stream level, or the archive level (in decreasing order of betterness.)