Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Summary of discussion #1
From: David Abrahams (dave_at_[hidden])
Date: 2010-06-03 12:18:00


At Wed, 02 Jun 2010 17:31:48 -0400,
David Abrahams wrote:
>
> At Wed, 2 Jun 2010 18:06:19 +0000 (UTC),
> Tomas Puverle wrote:
> >
> > > That looks a lot like a cast, though the type doesn't change in your design, >
> > so naming it something like "endian_cast" is not unreasonable.
> >
> > Since the type isn't supposed to change, I don't like the cast<> idea too much.
> > But let me sit on it.
> >
> > > Otherwise, swap_in_place<>() could be named "swap" while your swap<>()
> > > could be named something like "swapped_copy."
> >
> > These are good names - I might steal them ;)
>
> 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.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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