I have a POD struct that I de/serialize through appropriately overloaded save and load free functions[*]. In my case, de/serialization involves translating between different representations (uid <-> username, gid <-> groupname). This translation is encapsulated in a class Etc and currently I just have a local variable of class Etc in both methods. I'd prefer a way to inject the Etc instance into save and load. The ideal solution would meet these criteria: * The Etc instance is created externally to save/load. * No global or quasi-global (static or singleton) variables. * No changes to the serialized struct (i.e. not an additional pointer to an Etc instance). * Usable with existing archive classes without extension. As far as I can tell, so far, I can't get all of these. I'm hoping that there is a way that I have overlooked. Michael [*] https://github.com/mschuerig/preserfs/blob/master/src/DirectoryMetadata.cpp#... -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/