Boost logo

Boost :

Subject: Re: [boost] [serialization] load-only or save-only types?
From: David Abrahams (dave_at_[hidden])
Date: 2008-11-06 14:34:29


on Tue Nov 04 2008, "Robert Ramey" <ramey-AT-rrsd.com> wrote:

> 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

Thanks, I think that works!

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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