
10 Jun
2011
10 Jun
'11
12:43 p.m.
Robert Ramey <ramey <at> rrsd.com> writes:
If you REALLY want something like this, consider something [...] I'm not sure what else to say about this.
Robert Ramey
Thanks for your reply. First: I don't REALLY want my syntax: indeed, provide a "free" function as you suggest is a simple (good) way to add the "savable" feature. One question remains: how to deserialize onto an already instantiated object? Or: how to implement the Load function better than: template<class T> void FileLoad(const std::string & path, T & t){ std::ifstream ifs(path.c_str()); T* p; ia >> p; t = *p; delete p; } which is not exception safe, and not efficient. Nicolas.