
3 Jun
2010
3 Jun
'10
5:28 p.m.
How about this... template<endian_t From, class T> T convert_to_host(void* buf); // Coverts/copies a physical format into a big-/little-endian physical format. and template<endian_t To, class T> void convert_from_host(const T& x, void* buf); // Converts/copies a T into a big-/little-endian physical format. and template<endian_t From, endian_t To, class T> void convert_in_place(T& x); // Convert an object supposedly in 'From' endian format to an object in 'To' endian format in place. terry