I have an unkown object which is guaranteed to contain only POD's as
its member data.
Do the template functions below work correctly for saving and retrieval of its data from
a binary file?
Code:template< class T > inline void write_binary_data( const T& _t, std::ofstream& out ) { out.write( (char*)(&_t), sizeof(T) ); } template< class T > inline void read_binary_data( T& _t, std::ifstream& in ) { in.read( (char*)(&_t), sizeof(T) ); }




Reply With Quote
