Quote Originally Posted by kempofighter View Post
I'm not so sure about that since the OP did say that he was dealing with POD objects. Perhaps we are making the solution more complex than necessary? Why is the original template function needed since we are only dealing with POD objects? Why not just cast the pointer to the object into const char* and use the stream read/write functions directly? It isn't much different than copying the POD object to and from a character array using memcpy is it?
Assuming no pointer members as I said above, then yes, it's exactly the same---and probably good enough so long as the file only persists for the length of a single program run.

However, that solution becomes insufficient if you want a file which can persist between program runs, or more generally, between machines/compilers/options which may be used to build the programs.