
26 Apr
2004
26 Apr
'04
7:12 p.m.
Your library cannot be used to save/load anything before main() is entered nor can it be used to save/load anything after main() has been left.
Correct. It never occurred to me to mention this.
Robert Ramey
It probably could be addressed by some kind of lifetime management scheme. Essentially you need to make sure that before any serialization code is invoked all static initializes gets instantiated. I am not sure it doable since you actually within the library code may not know what should be instantiated. On the other hand I an not sure that any move in this direction even worth the trouble. I guess it may be convenient in some cases. Gennadiy.