[serialization] Versioning (or lack thereof) in load_construct_data

As far as I can tell, the version number passed into load_construct_data is not actually useful. This conclusion is based (among other things) on the fact that stack_construct (in serialization/detail/stack_constructor.hpp) always calls load_construct_data_adl with 0U for the version argument. This leads me to believe that in the current implementation if I specialize load_construct_data for one of my classes, I can never change it later, as the class version number from the input archive is inaccessible inside load_construct_data. Am I missing something obvious, or is it really the case that versioning doesn't work for load_construct_data right now? Thanks, Ben -- If this message helped you, consider buying an item from my wish list: <http://artins.org/ben/wishlist> I changed my name: <http://periodic-kingdom.org/People/NameChange.php>

Looks like a bug to me. stack_construct doesn't pass the version number. This would only show up in loading of collections and other places where one uses stack_sonstruct. It seems quite fixable to me. I'll look into it. Robert Ramey Ben Artin wrote:
As far as I can tell, the version number passed into load_construct_data is not actually useful. This conclusion is based (among other things) on the fact that stack_construct (in serialization/detail/stack_constructor.hpp) always calls load_construct_data_adl with 0U for the version argument.
This leads me to believe that in the current implementation if I specialize load_construct_data for one of my classes, I can never change it later, as the class version number from the input archive is inaccessible inside load_construct_data.
Am I missing something obvious, or is it really the case that versioning doesn't work for load_construct_data right now?
Thanks,
Ben

In article <drls2l$bt0$1@sea.gmane.org>, "Robert Ramey" <ramey@rrsd.com> wrote:
Looks like a bug to me. stack_construct doesn't pass the version number. This would only show up in loading of collections and other places where one uses stack_sonstruct. It seems quite fixable to me. I'll look into it.
I look forward to seeing your fix, because I am trying to write code similar to stack_construct and I don't see an obvious way to fix it right now -- I don't see an API that lets you load the preamble at that point in the code. I am sure that if my understanding that you need to load the preamble is correct, then you will show me how to do it right and I can apply it to my own problem :-) Thanks! Ben -- I changed my name: <http://periodic-kingdom.org/People/NameChange.php>
participants (2)
-
Ben Artin
-
Robert Ramey