Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Summary of discussion #1
From: Terry Golubiewski (tjgolubi_at_[hidden])
Date: 2010-06-03 13:28:16


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk