Boost logo

Boost :

Subject: Re: [boost] [serialization] load-only or save-only types?
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-11-04 09:11:47


David Abrahams wrote:
> I don't think there's any trickery involved. I'll just
>
> ar << transmit_type;
>
> ar >> receive_type;
>
> What am I missing?

BOOST_SERIALIZATION_SPLIT_FREE(transmit_type)

BOOST_SERIALIZATION_SPLIT_FREE(recieve_type)

template<class Archive>
save<transmit_type>(Archive ar, ...){...}
load<recieve_type>(...){..}.

leave undefined the following:

save<recieve_type>(...){..}.
load<transmit_type>(Archive ar, ...){...}

So that your get a compile time error if you
try to

ar >> transmit_type

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk