Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-08-26 12:57:40

Neal Becker wrote:
> I don't understand why this simple test doesn't compile. Any hints?
> template<class Archive>
> inline void save (Archive &ar, const unsigned int) const {
> for (int j = 0; j < 10; ++j)
> // ar << compute(j);
> ar << int(0);
> }

The above would be a problem. Serialization operators use reference to data
as arguments. An object pushed on the stack has no permanent address. So
it can't be serialized.

> template<class Archive>
> inline void load (Archive &ar, const unsigned int) {
> }

suppose you made the above work by doing something like:

    const int x = 0;
    ar << x;

If the above did work - that is if it inserted a 0 value into the archive,
then what would loading mean?

So the question is - what is the intention here?

Robert Ramey

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