
Joel de Guzman wrote:
Peter Dimov wrote:
You need to define a proxy Y object that can deserialize itself into thin air.
Very clever - I'm embarassed I didn't think about that.
I thought about that. But that would mean that blank_proxy<Y> knows all about Y -- its composition down to the leaves -- and wrap them all as blank_proxy<T>s. A hairy proposition, IMO.
Hmm - sounds like one needs proxy objects for all of Y's members and so one down to the primitive leaves. And here's another idea. create an archive adaptor which takes any archive and replaces its loading of primitives to something that just throws them away. so at some point one would try load(Archive & ar, Y & y, const unsigned version){ ar >> x; if(version == 1){ dummy_archive<Archive> da(ar); da >>y; } ar >> z; } I havn't written documentation on archive adaptor but polymorphic_?archives are examples of such a thing. Robert Ramey