Boost logo

Boost :

Subject: Re: [boost] [Endian] Unaligned fields in packed structs
From: Beman Dawes (bdawes_at_[hidden])
Date: 2011-09-10 07:24:27


On Tue, Sep 6, 2011 at 7:48 PM, Phil Endecott
<spam_from_boost_dev_at_[hidden]> wrote:

> ... I was already wondering about the choice of
> function signatures:
>
>  void endian::reorder(T&);  // in-place byteswap
>  void endian::reorder(T src, T& dest);  // out-of-place byteswap
>
> What is the rationale (or precedent) for these and not
>
>  T endian::reorder(T);
>
> ?
>
> If sin(theta) returns its result, why shouldn't reorder(val) do so too?

I've implemented your suggestion, run various tests, looked at the
generated code, and tried various uses cases.

Bottom line: I think you are right and will change conversion.hpp accordingly.

Thanks,

--Beman


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