Boost logo

Boost :

Subject: Re: [boost] [serialization] load-only or save-only types?
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2008-11-03 19:42:46


> I want to send out instances of one type and receive the same data
> format but build instances of a different type. Obviously I can just
> define serialize() for each of them, but can I define only save for the
> outgoing type and load for the incoming one, causing serialization in
> the other direction to be a compile-time error? Not a big deal, but it
> would be more expressive that way.

I'd use a wrapper type to have control over what types get instantiated on
the receiving end. This way you don't have to trick the serialization
library into handling the same data format differently on the save and load
ends.

Regards Hartmut


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