[phobos] Interest in having a serializer in Phobos?

Michel Fortin michel.fortin at michelf.com
Sun Aug 8 08:03:53 PDT 2010


Le 2010-08-08 à 10:37, Jacob a écrit :

> On 8 aug 2010, at 15:30, Michel Fortin wrote:
>> Another interesting point: it's probably necessary to be tolerant of type differences. For instance, if I serialize a size_t on a machine and unserialize it elsewhere, it might not be the same underlying integral type.
> 
> That deserves to think about.

Well, how it works in my serialization module is that all integral types are semantically identical once inside the serialized stream. So any integral type can be serialized/unserialized to another integral type. There's a runtime check that throws if the value to unserialize can't fit the type you're unserializing to.

Same for floating point.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list