7 Aug
2009
7 Aug
'09
12:56 p.m.
Dear list, I'm trying to write serialization code for Boost.System's error_codes, however I'm having trouble to serialize/deserialize an error_category, which are polymorphic singleton objects. I guess when saving, type information needs to be stored, like with polymorphic pointers? When loading, a global function (get_generic_category(), get_system_category(), etc.) could be used to obtain a reference to the singleton object. Is there any way to use the exported type information in such way that a reference to the correct singleton is obtained? Any suggestions on how to approach this? Thanks in advance, Kind regards, Rutger ter Borg