std.serialization: pre-voting review / discussion

ilya-stromberg ilya-stromberg-2009 at yandex.ru
Sun Sep 1 01:35:19 PDT 2013


On Sunday, 1 September 2013 at 08:33:51 UTC, ilya-stromberg wrote:
> On Thursday, 22 August 2013 at 19:53:53 UTC, Jacob Carlborg 
> wrote:
>> On 2013-08-22 21:30, ilya-stromberg wrote:
>>
>>> Great! What about more difficult cases? For example, we have:
>>>
>>> class Foo
>>> {
>>>   int a;
>>>   int b;
>>> }
>>>
>>> After changes we have new class:
>>>
>>> class Foo
>>> {
>>>   long b;
>>> }
>>>
>>> Can std.serialization load data to new class from old file? 
>>> It should
>>> ignore "a" and convert "b" from int to long.
>>
>> No it can't. It will throw an exception because it cannot find 
>> a "long" element:
>>
>> Could not find an element "long" with the attribute "key" with 
>> the value "b"
>
> Jacob, can you use clearer error messages and provide more 
> information for it?
> You can type full class/sruct name (via 
> std.traits.fullyQualifiedName) and field name and type: 
> information can not be found in the archive
>
> Please, put attention on it.

Sorry, I want to write:

Could not deserialize the field "b" with type "long" of class 
"Fouo": information can not be found in the archive.



More information about the Digitalmars-d mailing list