Boost logo

Boost :

Subject: Re: [boost] [boost::endian] Summary of discussion #1
From: John Bytheway (jbytheway+boost_at_[hidden])
Date: 2010-06-02 15:35:49


On 02/06/10 20:01, Tomas Puverle wrote:
> I am not married to the names in the current version of the code.
>
> I liked the earlier suggestion to rename "swap_in_place" to "swap" and the
> current "swap" to "swap_copy".

Indeed that's better, but I'm still not enamoured with it. At the risk
of confusing the issue, another possibility would be "swapped" for the
out-of-place version.

> But I am not totally opposed to endian::cast<> either. Names are a very
> subjective thing and I think it will become clearer which ones are preferable as
> I/others write/use the library. I will also be the first to admit that even
> though I try and come up with descriptive names, they are usually far from
> perfect, so this feedback is useful.
>
> Actually, now that I think about it, the cast<> notation may allow me to unify
> the swap/to/from functions into a single form:
>
> endian::cast<big_to_host>() //explicit direction
> endian::cast<from_litle>() //"to_host" is implicit
> endian::cast<to_big>() //"from_host" is implicit
>
> I actually really like that. What do you think?

Yes! I do like that. For the out-of-place version, I think this is
definitely better than the swap-based names.

John


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