
At Thu, 3 Jun 2010 16:36:29 +0000 (UTC), Tomas Puverle wrote:
I'd go with “swap” and “swapped.”
Amending that: watch out for unintended ADL effects with “swap.” It's one of those globally claimed names whose meaning (at least with two arguments) is fixed for all time w.r.t. unqualified calls.
I think the consensus was to use "endian_cast" for the function which returns a swapped copy of the underlying data and "endian_swap" for the function which performs the swapping in place (Rob's suggestions).
This is so that people can do
using namespace boost::endian;
int i = endian_cast<from_big>(j);
which seems pretty readable.
Ouch. Normally the destination type is in the <>s of a cast. Why not just two functions: boost::endian::from_big( x ) boost::endian::from_little( x ) ? -- Dave Abrahams BoostPro Computing http://www.boostpro.com